Make WordPress Core

Changeset 24367


Ignore:
Timestamp:
05/26/2013 06:34:33 AM (12 years ago)
Author:
koopersmith
Message:

Add Backbone property to the wp-backbone namespace. See #24424.

Location:
trunk/wp-includes/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/media-views.js

    r24361 r24367  
    855855    // This behavior has since been removed, and should not be used
    856856    // outside of the media manager.
    857     media.View = wp.View.extend({
     857    media.View = wp.Backbone.View.extend({
    858858        constructor: function( options ) {
    859859            if ( options && options.controller )
    860860                this.controller = options.controller;
    861861
    862             wp.View.apply( this, arguments );
     862            wp.Backbone.View.apply( this, arguments );
    863863        },
    864864
     
    884884        remove: function() {
    885885            this.dispose();
    886             return wp.View.prototype.remove.apply( this, arguments );
     886            return wp.Backbone.View.prototype.remove.apply( this, arguments );
    887887        }
    888888    });
  • trunk/wp-includes/js/wp-backbone.js

    r24361 r24367  
    2727
    2828
    29     // wp.Subviews
    30     // -----------
     29    // Create the WordPress Backbone namespace.
     30    wp.Backbone = {};
     31
     32
     33    // wp.Backbone.Subviews
     34    // --------------------
    3135    //
    3236    // A subview manager.
    33     wp.Subviews = function( view, views ) {
     37    wp.Backbone.Subviews = function( view, views ) {
    3438        this.view = view;
    3539        this._views = _.isArray( views ) ? { '': views } : views || {};
    3640    };
    3741
    38     wp.Subviews.extend = Backbone.Model.extend;
    39 
    40     _.extend( wp.Subviews.prototype, {
     42    wp.Backbone.Subviews.extend = Backbone.Model.extend;
     43
     44    _.extend( wp.Backbone.Subviews.prototype, {
    4145        // ### Fetch all of the subviews
    4246        //
     
    139143
    140144            _.each( views, function( subview ) {
    141                 var constructor = subview.Views || wp.Subviews,
     145                var constructor = subview.Views || wp.Backbone.Subviews,
    142146                    subviews = subview.views = subview.views || new constructor( subview );
    143147                subviews.parent   = this.view;
     
    354358
    355359
    356     // wp.View
    357     // -------
     360    // wp.Backbone.View
     361    // ----------------
    358362    //
    359363    // The base view class.
    360     wp.View = Backbone.View.extend({
     364    wp.Backbone.View = Backbone.View.extend({
    361365        // The constructor for the `Views` manager.
    362         Subviews: wp.Subviews,
     366        Subviews: wp.Backbone.Subviews,
    363367
    364368        constructor: function() {
Note: See TracChangeset for help on using the changeset viewer.