Explorar o código

Restore previously selected option when updating a drop-down list.

Roberto Agostino Vitillo %!s(int64=13) %!d(string=hai) anos
pai
achega
40e10d801e
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      editor/js/libs/ui.js

+ 3 - 0
editor/js/libs/ui.js

@@ -267,6 +267,7 @@ UI.Select.prototype.setMultiple = function ( boolean ) {
 };
 
 UI.Select.prototype.setOptions = function ( options ) {
+  var selected = this.dom.value;
 
 	while ( this.dom.children.length > 0 ) {
 
@@ -283,6 +284,8 @@ UI.Select.prototype.setOptions = function ( options ) {
 
 	}
 
+  this.dom.value = selected;
+
 	return this;
 
 };

粤ICP备19079148号