From bb2537b49b0fa6eb1b5ff71225fc735e60f1914d Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 4 Dec 2017 09:10:49 +0100 Subject: [PATCH] Implemented issue #1689 - Enable state "merged" for admin overviews, triggers and jobs. --- .../_ui_element/select_search.coffee | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 app/assets/javascripts/app/controllers/_ui_element/select_search.coffee diff --git a/app/assets/javascripts/app/controllers/_ui_element/select_search.coffee b/app/assets/javascripts/app/controllers/_ui_element/select_search.coffee new file mode 100644 index 000000000..2b53dd6d1 --- /dev/null +++ b/app/assets/javascripts/app/controllers/_ui_element/select_search.coffee @@ -0,0 +1,35 @@ +# coffeelint: disable=camel_case_classes +class App.UiElement.select_search extends App.UiElement.ApplicationUiElement + @render: (attribute, params) -> + + # set multiple option + if attribute.multiple + attribute.multiple = 'multiple' + else + attribute.multiple = '' + + delete attribute.filter + + # build options list based on config + @getConfigOptionList(attribute, params) + + # build options list based on relation + @getRelationOptionList(attribute, params) + + # add null selection if needed + @addNullOption(attribute, params) + + # sort attribute.options + @sortOptions(attribute, params) + + # finde selected/checked item of list + @selectedOptions(attribute, params) + + # disable item of list + @disabledOptions(attribute, params) + + # filter attributes + @filterOption(attribute, params) + + # return item + $( App.view('generic/select')(attribute: attribute) )