Media modal: Don't fire two AJAX calls on settings update.
Props koopersmith fixes #22611 git-svn-id: http://core.svn.wordpress.org/trunk@22907 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
346e45c56b
commit
a5253fd686
|
@ -2574,12 +2574,17 @@
|
|||
},
|
||||
|
||||
updateSetting: function( event ) {
|
||||
var $setting = $( event.target ).closest('[data-setting]');
|
||||
var $setting = $( event.target ).closest('[data-setting]'),
|
||||
setting, value;
|
||||
|
||||
if ( ! $setting.length )
|
||||
return;
|
||||
|
||||
this.model.save( $setting.data('setting'), event.target.value );
|
||||
setting = $setting.data('setting');
|
||||
value = event.target.value;
|
||||
|
||||
if ( this.model.get( setting ) !== value )
|
||||
this.model.save( setting, value );
|
||||
},
|
||||
|
||||
updateAll: function() {
|
||||
|
|
Loading…
Reference in New Issue