Преглед на файлове

Merge pull request #1678 from jdecuyper/feature-remove-duplicated-option

Remove duplicated options from multi-valued select boxes.
Igor Vaynberg преди 11 години
родител
ревизия
418a659adb
променени са 1 файла, в които са добавени 1 реда и са изтрити 3 реда
  1. 1 3
      select2.js

+ 1 - 3
select2.js

@@ -2842,9 +2842,7 @@ the specific language governing permissions and limitations under the Apache Lic
                 return;
             }
 
-            index = indexOf(this.id(data), val);
-
-            if (index >= 0) {
+            while((index = indexOf(this.id(data), val)) >= 0) {
                 val.splice(index, 1);
                 this.setVal(val);
                 if (this.select) this.postprocessResults();