Sfoglia il codice sorgente

HUE-4116 [editor] Accept non observables on select2 parameters

Enrico Berti 9 anni fa
parent
commit
174141c

+ 5 - 1
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -2071,7 +2071,11 @@
         if (options.type == "parameter" && options.update != "") {
           var _found = false;
           allBindingsAccessor().options().forEach(function(opt){
-            if (opt[allBindingsAccessor().optionsValue]() == options.update){
+            var _option = opt[allBindingsAccessor().optionsValue];
+            if (ko.isObservable(_option)){
+              _option = _option();
+            }
+            if (_option == options.update){
               _found = true;
             }
           });