Changeset 26161
- Timestamp:
- 11/14/2013 05:53:15 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media-views.js
r24784 r26161 1 /* global _wpMediaViewsL10n, confirm, getUserSetting, setUserSetting */ 1 2 (function($){ 2 3 var media = wp.media, 3 4 Attachment = media.model.Attachment, 4 5 Attachments = media.model.Attachments, 5 Query = media.model.Query,6 6 l10n; 7 7 … … 119 119 120 120 trigger: function( event ) { 121 var base; 121 var base, args; 122 122 123 if ( ! this._mode ) 123 124 return; 124 125 125 varargs = _.toArray( arguments );126 args = _.toArray( arguments ); 126 127 base = this.id + ':' + event; 127 128 … … 456 457 457 458 defaultDisplaySettings: function( attachment ) { 458 settings = this._defaultDisplaySettings;459 var settings = this._defaultDisplaySettings; 459 460 if ( settings.canEmbed = this.canEmbed( attachment ) ) 460 461 settings.link = 'embed'; … … 496 497 recordSelection: function() { 497 498 var selection = this.get('selection'), 498 manager = this.frame._selection, 499 filtered; 499 manager = this.frame._selection; 500 500 501 501 if ( ! this.get('syncSelection') || ! manager || ! selection ) … … 1060 1060 // Generate the tab states. 1061 1061 _.each( tabs, function( title, id ) { 1062 var frame =this.state( 'iframe:' + id ).set( _.defaults({1062 this.state( 'iframe:' + id ).set( _.defaults({ 1063 1063 tab: id, 1064 1064 src: tabUrl + '&tab=' + id, … … 1124 1124 // Map some of the modal's methods to the frame. 1125 1125 _.each(['open','close','attach','detach','escape'], function( method ) { 1126 media.view.MediaFrame.prototype[ method ] = function( view) {1126 media.view.MediaFrame.prototype[ method ] = function() { 1127 1127 if ( this.modal ) 1128 1128 this.modal[ method ].apply( this.modal, arguments ); … … 1151 1151 1152 1152 createSelection: function() { 1153 var controller = this, 1154 selection = this.options.selection; 1153 var selection = this.options.selection; 1155 1154 1156 1155 if ( ! (selection instanceof media.model.Selection) ) { … … 1932 1931 progress: function() { 1933 1932 var queue = this.queue, 1934 $bar = this.$bar, 1935 memo = 0; 1933 $bar = this.$bar; 1936 1934 1937 1935 if ( ! $bar || ! queue.length ) … … 2112 2110 media.view.Toolbar.Select = media.view.Toolbar.extend({ 2113 2111 initialize: function() { 2114 var options = this.options, 2115 controller = options.controller, 2116 selection = controller.state().get('selection'); 2112 var options = this.options; 2117 2113 2118 2114 _.bindAll( this, 'clickSelect' ); … … 2619 2615 model = this.model, 2620 2616 method = options && options.method, 2621 single, between,models, singleIndex, modelIndex;2617 single, models, singleIndex, modelIndex; 2622 2618 2623 2619 if ( ! selection ) … … 2900 2896 this._viewsByCid = {}; 2901 2897 2902 this.collection.on( 'add', function( attachment , attachments, options) {2898 this.collection.on( 'add', function( attachment ) { 2903 2899 this.views.add( this.createAttachmentView( attachment ), { 2904 2900 at: this.collection.indexOf( attachment ) … … 2906 2902 }, this ); 2907 2903 2908 this.collection.on( 'remove', function( attachment , attachments, options) {2904 this.collection.on( 'remove', function( attachment ) { 2909 2905 var view = this._viewsByCid[ attachment.cid ]; 2910 2906 delete this._viewsByCid[ attachment.cid ]; … … 3067 3063 }, 3068 3064 3069 scroll: function( event) {3065 scroll: function() { 3070 3066 // @todo: is this still necessary? 3071 3067 if ( ! this.$el.is(':visible') ) … … 3150 3146 }, 3151 3147 3152 change: function( event) {3148 change: function() { 3153 3149 var filter = this.filters[ this.el.value ]; 3154 3150 … … 3397 3393 createSingle: function() { 3398 3394 var sidebar = this.sidebar, 3399 single = this.options.selection.single(), 3400 views = {}; 3395 single = this.options.selection.single(); 3401 3396 3402 3397 sidebar.set( 'details', new media.view.Attachment.Details({ … … 3631 3626 }, 3632 3627 3633 updateChanges: function( model , options) {3628 updateChanges: function( model ) { 3634 3629 if ( model.hasChanged() ) 3635 3630 _( model.changed ).chain().keys().each( this.update, this ); … … 3757 3752 }, 3758 3753 3759 editAttachment: function( event) {3754 editAttachment: function() { 3760 3755 this.$el.addClass('needs-refresh'); 3761 3756 },
Note: See TracChangeset
for help on using the changeset viewer.