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:
Ryan Boren 2012-11-28 22:27:13 +00:00
parent 346e45c56b
commit a5253fd686
1 changed files with 7 additions and 2 deletions

View File

@ -2574,12 +2574,17 @@
}, },
updateSetting: function( event ) { updateSetting: function( event ) {
var $setting = $( event.target ).closest('[data-setting]'); var $setting = $( event.target ).closest('[data-setting]'),
setting, value;
if ( ! $setting.length ) if ( ! $setting.length )
return; 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() { updateAll: function() {