Quellcode durchsuchen

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

Roberto Agostino Vitillo vor 12 Jahren
Ursprung
Commit
40e10d801e
1 geänderte Dateien mit 3 neuen und 0 gelöschten Zeilen
  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;
 
 };