This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * jQuery UI Toggle Switch | |
| * | |
| * http://taitems.tumblr.com/post/17853682273/jquery-ui-toggleswitch-ux-lab-005 | |
| * | |
| * Depends: | |
| * jquery.ui.slider.js | |
| */ | |
| (function (factory) { | |
| if (typeof exports === 'object') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This code assumes you start all your sub-apps during the root-app's init | |
| // phase. If not, this same logic can be bound to a different event (ex. start). | |
| rootApp.on("initialize:after", function () { | |
| vent.trigger("system:default:region:set", rootApp.body); | |
| }); | |
| // Then in some other sub-application | |
| define([ | |
| 'marionette', | |
| 'mysupervent' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var SelectView = Marionette.ItemView.extend({ | |
| initialize: function(options) { | |
| this.bindTo(this, "selected", onSelect); | |
| this.bindTo(this, "deselected", onDeselect); | |
| }, | |
| onSelect: function() { | |
| this.model.fetch(); | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var result = Marionette.ItemView.prototype.render.apply(this, arguments); | |
| // FIX: Issue 351 - https://github.com/marionettejs/backbone.marionette/pull/351 | |
| // inject regions into template | |
| var that = this; | |
| _.each(this.regionManagers, function(region){ | |
| if (region.currentView) { | |
| that.$el.find(region.el).html(region.currentView.$el); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define([ | |
| "underscore", | |
| "backbone", | |
| "marionette", | |
| "vent" | |
| ], | |
| /** | |
| * Creates the primary `Marionette.Application` object that runs the admin framework. Provides a central point | |
| * from which all other sub-applications are started, shown, hidden, and stopped. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This is heavily based on Backbone.SubRoute (https://github.com/ModelN/backbone.subroute) by Dave Cadwallader, who | |
| // helped me out in this discussion thread: | |
| // https://groups.google.com/forum/?fromgroups=#!topic/backbone-marionette/KTw7USoA6Gs | |
| ;define([ | |
| 'underscore', | |
| 'marionette' | |
| ], | |
| /** | |
| * A module that defines and adds Marionette.SubAppRouter to the Marionette object |
NewerOlder