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
| <a data-bind="text:linkText,attr:{href:linkUrl,title:linkText}"></a> |
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(["views/baseViewMixins", "backbone.marionette"], | |
| function(baseViewMixins, Marionette) { | |
| return Marionette.ItemView.extend(baseViewMixins); | |
| }); |
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, |
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 PageableViewMixin { | |
| events: { | |
| "click a.nextPage": "nextPage", | |
| "click a.prevPage": "prevPage" | |
| }, | |
| nextPage: function(e) { | |
| // paging logic | |
| }, | |
| prevPage: function(e) { | |
| // paging logic |
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 DigitalAssetsCollection = Backbone.Collection.extend({ | |
| mixins: [ NestedModelMixin, PageableCollectionMixin ] | |
| }); |
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 NestedModelMixin = { | |
| initialize: function(undefined, options) { | |
| this.parent = options && options.parent; | |
| if ( !this.parent || ! this.nestedPath ) { | |
| throw "a parent model, corresponding to the parent of this Nested, " + | |
| "must be provided at initialization, as well as the nestedPath"; | |
| } | |
| }, | |
| // Path to query against is the root path of the parent model, plus the collection key, e.g. |
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 Mixin = { | |
| mixedInFunction: function() { | |
| console.log("I'm a mixed-in function!"); | |
| } | |
| } | |
| var ModelWithMixin = Backbone.Model.extend(_.extend({ | |
| initialize: function() { | |
| console.log("I'm a constructor!"); | |
| } |
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 NestedCollection = Backbone.Collection.extend({ | |
| // Takes parent and nestedPath, corresponding to the parent | |
| // of this nested collection, and the name of the nested | |
| // resource to be used in the url for this collection. | |
| initialize: function(undefined, options) { | |
| Backbone.Collection.prototype.initialize.apply(this, arguments); | |
| this.parent = options && options.parent; | |
| if ( !this.parent || ! this.nestedPath ) { | |
| throw "a parent model, corresponding to the parent of this Nested, " + | |
| "must be provided at initialization, as well as the nestedPath"; |
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 NestedCollection = Backbone.Collection.extend({ | |
| // Takes parent and nestedPath, corresponding to the parent | |
| // of this nested collection, and the name of the nested | |
| // resource to be used in the url for this collection. | |
| initialize: function(undefined, options) { | |
| Backbone.Collection.prototype.initialize.apply(this, arguments); | |
| this.parent = options && options.parent; | |
| if ( !this.parent || ! this.nestedPath ) { | |
| throw "a parent model, corresponding to the parent of this Nested, " + | |
| "must be provided at initialization, as well as the nestedPath"; |
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 DigitalAssetsCollection = Backbone.Collection.extend({ | |
| model: Backbone.Model, | |
| initialize: function(undefined, options) { | |
| Backbone.Collection.prototype.initialize.apply(this, arguments); | |
| this.parent = options && options.parent; | |
| if ( !this.parent ) { | |
| throw "a parent product must be provided at initialization"; | |
| } | |
| }, | |