Commit 351d1470 authored by Gabriel Monnerat's avatar Gabriel Monnerat

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

parent 58ad111a
...@@ -346,12 +346,15 @@ ...@@ -346,12 +346,15 @@
}) })
.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,6 +917,7 @@ ...@@ -914,6 +917,7 @@
domsugar(table_element.querySelector('tr'), th_element_list); domsugar(table_element.querySelector('tr'), th_element_list);
if (gadget.state.extended_search) {
domsugar(container, [ domsugar(container, [
domsugar('div', { domsugar('div', {
"class": 'ui-table-header ui-header' "class": 'ui-table-header ui-header'
...@@ -921,6 +925,7 @@ ...@@ -921,6 +925,7 @@
table_element, table_element,
domsugar('nav') 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,6 +1201,7 @@ ...@@ -1190,6 +1201,7 @@
}) })
); );
} }
if (!gadget.state.extended_search) {
domsugar(gadget.element.querySelector(".graphic_section"), [ domsugar(gadget.element.querySelector(".graphic_section"), [
domsugar("select", { domsugar("select", {
"name": "GraphicSelect", "name": "GraphicSelect",
...@@ -1197,9 +1209,12 @@ ...@@ -1197,9 +1209,12 @@
}, sub_element_list), }, sub_element_list),
domsugar("div", {"class": "graphic_area"}) 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