Browse Source

Maintenance: Move tree select search config to ui element.

Rolf Schmidt 2 years ago
parent
commit
4f07ae1dda

+ 0 - 3
app/assets/javascripts/app/controllers/_ui_element/_application_selector.coffee

@@ -494,9 +494,6 @@ class App.UiElement.ApplicationSelector
         config['value'] = @buildValueConfigValue(elementFull, elementRow, groupAndAttribute, elements, meta, attribute)
       if 'multiple' of config
         config = @buildValueConfigMultiple(config, meta)
-      if config.tag is 'tree_select'
-        config.multiple = true
-        config.nulloption = true
       if config.relation is 'User'
         config.multiple = false
         config.nulloption = false

+ 7 - 0
app/assets/javascripts/app/controllers/_ui_element/tree_select_search.coffee

@@ -1,2 +1,9 @@
 # coffeelint: disable=camel_case_classes
 class App.UiElement.tree_select_search extends App.UiElement.multi_tree_select
+  @render: (attributeConfig, params) ->
+    attributeConfig = $.extend(true, {}, attributeConfig)
+
+    attributeConfig.multiple   = true
+    attributeConfig.nulloption = true
+
+    super