Skip to content
Permalink
Browse files

Fix select2 elements in floating ListOf valuespec

Change-Id: I5a57ba236990229a6757fb26d7fc4f772d21b242
  • Loading branch information
LarsMichelsen committed Jun 13, 2019
1 parent 3d515a0 commit 7abe7bcd3d7328dfa38474335c7d1f6ae1ebbec8
Showing with 4 additions and 3 deletions.
  1. +2 −1 cmk/gui/valuespec.py
  2. +2 −2 web/htdocs/js/modules/forms.js
@@ -1326,7 +1326,8 @@ def _show_reference_entry(self, varprefix, index, value):
html.close_table()

elif self._style == ListOf.Style.FLOATING:
html.open_div(id_="%s_prototype" % varprefix, style="display:none;")
html.open_div(
id_="%s_prototype" % varprefix, class_="vlof_prototype", style="display:none;")

self._show_entry(varprefix, index, value)

@@ -41,7 +41,7 @@ function enable_select2_dropdowns(container) {
if (!container)
container = $(document);

elements = $(container).find(".select2-enable").not("tbody.vlof_prototype .select2-enable");
elements = $(container).find(".select2-enable").not(".vlof_prototype .select2-enable");
elements.select2({
dropdownAutoWidth : true,
minimumResultsForSearch: 5
@@ -55,7 +55,7 @@ function enable_label_input_fields(container) {
let elements = container.querySelectorAll("input.labels");
elements.forEach(element => {
// Do not tagify objects that are part of a ListOf valuespec template
if (element.closest("tbody.vlof_prototype") !== null) {
if (element.closest(".vlof_prototype") !== null) {
return;
}

0 comments on commit 7abe7bc

Please sign in to comment.
You can’t perform that action at this time.