Last active
December 20, 2015 22:48
-
-
Save dspangen/6207532 to your computer and use it in GitHub Desktop.
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(["backbone", "backbone.marionette", "backbone.epoxy", "views/mixins/epoxyCustomBindingHandlers", "views/mixins/epoxyCustomBindingFilters"], | |
function(Backbone, Marionette, Epoxy, EpoxyCustomBindingHandlers, EpoxyCustomBindingFilters) { | |
// Base set of functions that can be mixed into standard views such as ItemViews, CompositeViews, etc. | |
return { | |
bindingHandlers: EpoxyCustomBindingHandlers, | |
bindingFilters: EpoxyCustomBindingFilters, | |
epoxyBindingEnabled: true, | |
initialize: function(options) { | |
if (this.epoxyBindingEnabled) { | |
this.epoxify(); | |
} | |
this.triggerMethod("initialize"); | |
}, | |
epoxify: function() { | |
Epoxy.View.mixin(this); | |
this.listenTo(this, "ui:bind", this.applyBindings); | |
this.listenTo(this, "before:close", this.removeBindings); | |
}, | |
// Override Marionette's impl so we can trigger our own event | |
bindUIElements : function() { | |
this.trigger("ui:bind"); | |
Marionette.View.prototype.bindUIElements.apply(this, arguments); | |
} | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment