Changeset 29072
- Timestamp:
- 07/10/2014 06:09:46 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media-grid.js
r29071 r29072 433 433 } 434 434 435 this.options.hasPrevious = ( this.options.library.indexOf( this.options.model ) > 0 ) ? true : false;436 this.options.hasNext = ( this.options.library.indexOf( this.options.model ) < this.options.library.length - 1 ) ? true : false;435 this.options.hasPrevious = this.hasPrevious(); 436 this.options.hasNext = this.hasNext(); 437 437 438 438 // Initialize modal container view. … … 546 546 */ 547 547 previousMediaItem: function() { 548 if ( ! this. options.hasPrevious )548 if ( ! this.hasPrevious() ) { 549 549 return; 550 } 550 551 this.modal.close(); 551 552 this.trigger( 'edit:attachment:previous', this.model ); … … 556 557 */ 557 558 nextMediaItem: function() { 558 if ( ! this. options.hasNext )559 if ( ! this.hasNext() ) { 559 560 return; 561 } 560 562 this.modal.close(); 561 563 this.trigger( 'edit:attachment:next', this.model ); … … 589 591 // The right arrow key 590 592 if ( event.keyCode === 39 ) { 591 if ( ! this.hasNext ) {593 if ( ! this.hasNext() ) { 592 594 return; 593 595 } … … 596 598 // The left arrow key 597 599 if ( event.keyCode === 37 ) { 598 if ( ! this.hasPrevious ) {600 if ( ! this.hasPrevious() ) { 599 601 return; 600 602 }
Note: See TracChangeset
for help on using the changeset viewer.