Make WordPress Core

Changeset 29551


Ignore:
Timestamp:
08/20/2014 05:10:03 PM (12 years ago)
Author:
wonderboymusic
Message:

Media Grid: Cleanup toggling of Next/Previous in Edit modal.

Fixes #29264.

File:
1 edited

Legend:

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

    r29532 r29551  
    391391
    392392                        this.title.mode( 'default' );
    393 
    394                         this.options.hasPrevious = this.hasPrevious();
    395                         this.options.hasNext = this.hasNext();
     393                        this.toggleNav();
    396394                },
    397395
    … …  
    501499                },
    502500
     501                toggleNav: function() {
     502                        this.$('.left').toggleClass( 'disabled', ! this.hasPrevious() );
     503                        this.$('.right').toggleClass( 'disabled', ! this.hasNext() );
     504                },
     505
    503506                /**
    504507                 * Rerender the view.
    … …  
    511514                                this.content.render();
    512515                        }
    513                         this.$('.left').toggleClass( 'disabled', ! this.hasPrevious() );
    514                         this.$('.right').toggleClass( 'disabled', ! this.hasNext() );
     516
     517                        this.toggleNav();
    515518                },
    516519
Note: See TracChangeset for help on using the changeset viewer.