Commit 2f93803a authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_web_renderjs_ui: prototype to only display listbox if there is search query

parent 522dbdc9
...@@ -346,11 +346,14 @@ ...@@ -346,11 +346,14 @@
}) })
.push(function () { .push(function () {
var table = gadget.element.querySelector("table"), var table = gadget.element.querySelector("table"),
old_container;
if (table) {
old_container = table.querySelector(container_name); old_container = table.querySelector(container_name);
if (old_container) { if (old_container) {
table.replaceChild(container, old_container); table.replaceChild(container, old_container);
} else { } else {
table.appendChild(container); table.appendChild(container);
}
} }
return table; return table;
}); });
...@@ -914,13 +917,15 @@ ...@@ -914,13 +917,15 @@
domsugar(table_element.querySelector('tr'), th_element_list); domsugar(table_element.querySelector('tr'), th_element_list);
domsugar(container, [ if (gadget.state.extended_search) {
domsugar('div', { domsugar(container, [
"class": 'ui-table-header ui-header' domsugar('div', {
}, div_element_list), "class": 'ui-table-header ui-header'
table_element, }, div_element_list),
domsugar('nav') table_element,
]); domsugar('nav')
]);
}
}); });
} }
...@@ -932,14 +937,17 @@ ...@@ -932,14 +937,17 @@
result_queue result_queue
.push(function () { .push(function () {
var loading_element = gadget.element.querySelector(".listboxloader"), var loading_element = gadget.element.querySelector(".listboxloader"),
loading_element_classList = loading_element.classList, loading_element_classList,
tbody_classList;
if (loading_element) {
loading_element_classList = loading_element.classList;
tbody_classList = gadget.element.querySelector("table").querySelector("tbody").classList; tbody_classList = gadget.element.querySelector("table").querySelector("tbody").classList;
// Set the loading icon and trigger line calculation // Set the loading icon and trigger line calculation
loading_element_classList.add.apply(loading_element_classList, loading_class_list); loading_element_classList.add.apply(loading_element_classList, loading_class_list);
// remove pagination information // remove pagination information
loading_element.textContent = ''; loading_element.textContent = '';
tbody_classList.add(disabled_class); tbody_classList.add(disabled_class);
}
return gadget.fetchLineContent(false); return gadget.fetchLineContent(false);
}); });
...@@ -1171,9 +1179,12 @@ ...@@ -1171,9 +1179,12 @@
}) })
.push(function () { .push(function () {
var loading_element = gadget.element.querySelector(".listboxloader"), var loading_element = gadget.element.querySelector(".listboxloader"),
loading_element_classList;
if (loading_element) {
loading_element_classList = loading_element.classList; loading_element_classList = loading_element.classList;
loading_element_classList.remove.apply(loading_element_classList, loading_class_list); loading_element_classList.remove.apply(loading_element_classList, loading_class_list);
loading_element.textContent = '(' + pagination_message + ')'; loading_element.textContent = '(' + pagination_message + ')';
}
}) })
.push(function () { .push(function () {
var sub_element_list = [ var sub_element_list = [
...@@ -1190,16 +1201,20 @@ ...@@ -1190,16 +1201,20 @@
}) })
); );
} }
domsugar(gadget.element.querySelector(".graphic_section"), [ if (!gadget.state.extended_search) {
domsugar("select", { domsugar(gadget.element.querySelector(".graphic_section"), [
"name": "GraphicSelect", domsugar("select", {
"value": gadget.state.graphic_type "name": "GraphicSelect",
}, sub_element_list), "value": gadget.state.graphic_type
domsugar("div", {"class": "graphic_area"}) }, sub_element_list),
]); domsugar("div", {"class": "graphic_area"})
]);
}
}); });
}); });
if (gadget.state.graphic_type && gadget.state.graphic_type !== "") { if (!gadget.state.extended_search &&
gadget.state.graphic_type &&
gadget.state.graphic_type !== "") {
result_queue result_queue
.push(function () { .push(function () {
return gadget.declareGadget('gadget_graphic.html', { return gadget.declareGadget('gadget_graphic.html', {
......
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>997.10044.21385.7219</string> </value> <value> <string>997.21665.57108.32682</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1640784531.93</float> <float>1641481115.02</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment