Giter Club home page Giter Club logo

efx's People

Contributors

ebollens avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

efx's Issues

Mark Active Triggers in Tabs

Tabbed navigation in ucla-oarc-web/WebBlocks#298 demonstrates a use case where it would be awful nice to have a way of recognizing which tab target is active. Right now, there's no state modified when a trigger is active. Let's introduce a new data-active attribute for this.

First off, the initializer should be modified:

if(!_.inState(target, 'show'))
    _.addState(target, 'hide')
else
    trigger.attr('data-active', true)

Then, we need to switch this state during the click handler:

$.each(_.getState(target), function(idx,state){
    var containerMatch = state.match(/^c\[(.*)\]$/);
    if(containerMatch)
        $('[data-tabs~="'+state+'"]').each(function(){
            $.each(_.getState($(this)), function(idx,state){
                var targetMatch = state.match(/^t\[(.*)\]$/);
                if(targetMatch)
                    $('#'+targetMatch[1]).removeAttr('data-active');
            })
        })
});

$.each(_.getState(target), function(idx,state){
    var targetMatch = state.match(/^t\[(.*)\]$/);
    if(targetMatch)
        $('#'+targetMatch[1]).attr('data-active', true);
});

Multi-Event Support

Right now, the only event that the library supports is click. This should be modified so that effects drivers can be registered for any type of events.

Accordion << Tabs

Accordion is actually a subset of tabs - where the tabs are organized within the accordion as a whole. As such, I think it makes sense to possible rearrange the naming convention of accordion versus tabs so that its actually called tabs and then we just provide a subset of markup that shows how to make an accordion from it.

efx awareness of webblocks breakpoints

Right now, efx toggle will hide an element as desired, however I only want to use it at a certain breakpoint.

To remedy this, I've set a media query to display:none on the menu at a smaller breakpoint, hoping that efx would toggle it to visible, but the button with the effect attached to it does not have an effect.

When I remove the media query, behavior returns to normal.

Is there a better way to do this?

/cc @ebollens @chris4ucla

Prevent Multiple Event Attachments

Right now, if you invoke .efx() multiple times applying to the same trigger, it attaches the events multiple times. This should not be allowed, as it will cause the effect to happen multiple times.

:focus with data-target

Ensure that the data-target receives focus, such as in:

<a data-target="#tab-1">Tab 1</a>

The kicker here is not the a tag, which probably does, but rather than any data-target should always receive focus.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.