Explorar el Código

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

Enrico Berti hace 9 años
padre
commit
174141c
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

+ 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;
             }
           });