]> git.mjollnir.org Git - moodle.git/commitdiff
user selection: MDL-17073 add options to control the search in a collapsible region...
authortjhunt <tjhunt>
Tue, 4 Nov 2008 07:24:07 +0000 (07:24 +0000)
committertjhunt <tjhunt>
Tue, 4 Nov 2008 07:24:07 +0000 (07:24 +0000)
user/selector/script.js

index aed9acd5f3d8a903453a01cb688ccd56f8b73853..529960d121d9c784cb80466aa3580069856b0123 100644 (file)
@@ -378,7 +378,7 @@ user_selector.prototype.output_options = function(data) {
         var options = optgroup.getElementsByTagName('option');
         while (options.length > 0) {
             var option = options[0];
-            if (preserveselected && option.selected) {
+            if (option.selected) {
                 var optiontext = option.innerText || option.textContent
                 this.selected[option.value] = { id: option.value, name: optiontext, disabled: option.disabled };
             }
@@ -416,7 +416,7 @@ user_selector.prototype.output_options = function(data) {
         areprevselected = true;
         break;
     }
-    if (areprevselected) {
+    if (preserveselected && areprevselected) {
         this.output_group(this.insert_search_into_str(this.strprevselected, this.lastsearch), this.selected, true);
     }
     this.selected = null;