Changeset 21773
- Timestamp:
- 09/06/2012 01:35:33 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/media-views.js
r21771 r21773 548 548 delete this.$bar; 549 549 550 // Check if the model is selected. 551 if ( this.controller.selection.has( this.model ) ) 552 this.select(); 553 550 554 return this; 551 555 }, … … 562 566 563 567 select: function( model, collection ) { 564 if ( collection === this.controller.selection ) 565 this.$el.addClass('selected'); 568 // If a collection is provided, check if it's the selection. 569 // If it's not, bail; we're in another selection's event loop. 570 if ( collection && collection !== this.controller.selection ) 571 return; 572 573 this.$el.addClass('selected'); 566 574 }, 567 575 568 576 deselect: function( model, collection ) { 569 if ( collection === this.controller.selection ) 570 this.$el.removeClass('selected'); 577 // If a collection is provided, check if it's the selection. 578 // If it's not, bail; we're in another selection's event loop. 579 if ( collection && collection !== this.controller.selection ) 580 return; 581 582 this.$el.removeClass('selected'); 571 583 } 572 584 });
Note: See TracChangeset
for help on using the changeset viewer.