Skip to content

Overwrite jmpress function #177

@mkbrv

Description

@mkbrv

Considering the cube example:
http://jmpressjs.github.io/jmpress.js/examples/cube/#/front

var cube = $('#cube');
$.jmpress("register", "up", function() {
    var stepData = cube.jmpress("active").data("stepData");
    if(stepData.up)
        cube.jmpress("select", stepData.up);
});

Using AngularJS routing (or simple ajax to bring different views), rebuilding a slider like the one presented above will not work since I cannot overwrite an event.

/**
     * Register a callback or a jmpress function
     *
     * @access public
     * @param name String the name of the callback or function
     * @param func Function? the function to be added
     */
    function register(name, func) {
        if( $.isFunction(func) ) {
            if( methods[name] ) {
                $.error( "function " + name + " is already registered." );
            } else {
                methods[name] = func;
            }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions