diff --git a/wp-includes/js/media-views.js b/wp-includes/js/media-views.js index ac363b4812..ba4b653703 100644 --- a/wp-includes/js/media-views.js +++ b/wp-includes/js/media-views.js @@ -854,12 +854,12 @@ // // This behavior has since been removed, and should not be used // outside of the media manager. - media.View = wp.View.extend({ + media.View = wp.Backbone.View.extend({ constructor: function( options ) { if ( options && options.controller ) this.controller = options.controller; - wp.View.apply( this, arguments ); + wp.Backbone.View.apply( this, arguments ); }, dispose: function() { @@ -883,7 +883,7 @@ remove: function() { this.dispose(); - return wp.View.prototype.remove.apply( this, arguments ); + return wp.Backbone.View.prototype.remove.apply( this, arguments ); } }); diff --git a/wp-includes/js/wp-backbone.js b/wp-includes/js/wp-backbone.js index 79061d6048..4e16956455 100644 --- a/wp-includes/js/wp-backbone.js +++ b/wp-includes/js/wp-backbone.js @@ -26,18 +26,22 @@ window.wp = window.wp || {}; }); - // wp.Subviews - // ----------- + // Create the WordPress Backbone namespace. + wp.Backbone = {}; + + + // wp.Backbone.Subviews + // -------------------- // // A subview manager. - wp.Subviews = function( view, views ) { + wp.Backbone.Subviews = function( view, views ) { this.view = view; this._views = _.isArray( views ) ? { '': views } : views || {}; }; - wp.Subviews.extend = Backbone.Model.extend; + wp.Backbone.Subviews.extend = Backbone.Model.extend; - _.extend( wp.Subviews.prototype, { + _.extend( wp.Backbone.Subviews.prototype, { // ### Fetch all of the subviews // // Returns an array of all subviews. @@ -138,7 +142,7 @@ window.wp = window.wp || {}; this._views[ selector ] = next; _.each( views, function( subview ) { - var constructor = subview.Views || wp.Subviews, + var constructor = subview.Views || wp.Backbone.Subviews, subviews = subview.views = subview.views || new constructor( subview ); subviews.parent = this.view; subviews.selector = selector; @@ -353,13 +357,13 @@ window.wp = window.wp || {}; }); - // wp.View - // ------- + // wp.Backbone.View + // ---------------- // // The base view class. - wp.View = Backbone.View.extend({ + wp.Backbone.View = Backbone.View.extend({ // The constructor for the `Views` manager. - Subviews: wp.Subviews, + Subviews: wp.Backbone.Subviews, constructor: function() { this.views = new this.Subviews( this, this.views );