WordPress.org

Make WordPress Core

Changeset 22907


Ignore:
Timestamp:
11/28/12 22:27:13 (17 months ago)
Author:
ryan
Message:

Media modal: Don't fire two AJAX calls on settings update.

Props koopersmith
fixes #22611

File:
1 edited

Legend:

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

    r22892 r22907  
    25752575 
    25762576        updateSetting: function( event ) { 
    2577             var $setting = $( event.target ).closest('[data-setting]'); 
     2577            var $setting = $( event.target ).closest('[data-setting]'), 
     2578                setting, value; 
    25782579 
    25792580            if ( ! $setting.length ) 
    25802581                return; 
    25812582 
    2582             this.model.save( $setting.data('setting'), event.target.value ); 
     2583            setting = $setting.data('setting'); 
     2584            value   = event.target.value; 
     2585 
     2586            if ( this.model.get( setting ) !== value ) 
     2587                this.model.save( setting, value ); 
    25832588        }, 
    25842589 
Note: See TracChangeset for help on using the changeset viewer.