Skip to content
This repository has been archived by the owner on Dec 16, 2020. It is now read-only.

[unmaintained] A view that acts as a region and can transition between different states

License

Notifications You must be signed in to change notification settings

gravplats/marionette.stateview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marionette.StateView

A View that acts as a region and can transition between different states. The StateView is a container for other views and does not have a template of its own.

Usage

Specifiy an initialView and a views map. The StateView listens for view events (as defined by the views map) from the current view in order to transition to another view.

    var View1 = Marionette.ItemView.extend({
        // definition...

        // should trigger 'view:2' to transition to View2.
        triggers: {
            'click .selector': 'view:2'
        }
    });

    var View2 = Marionette.ItemView.extend({
        // definition...

        // should trigger 'view:1' to transition to View1.
        triggers: {
            'click .selector': 'view:1'
        }
    });

    var StateView = Marionette.StateView.extend({
        initialView: 'view:1',

        views: {
            'view:1': View1,
            'view:2': View2
        }
    });

License

Licensed under MIT. Please refer to LICENSE for more information.

About

[unmaintained] A view that acts as a region and can transition between different states

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published