Commit 859aad11 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_web_renderjs_ui: stop hide buttons and deactivate it when listbox is empty

parent 2c9f1dbe
...@@ -4,6 +4,10 @@ div[data-gadget-url$="gadget_erp5_searchfield.html"] .graphic-button-section > b ...@@ -4,6 +4,10 @@ div[data-gadget-url$="gadget_erp5_searchfield.html"] .graphic-button-section > b
border-radius: 0.325em; border-radius: 0.325em;
} }
.graphic-button-section { div[data-gadget-url$="gadget_erp5_searchfield.html"] .graphic-button-section > button:disabled {
color: #808080;
}
div[data-gadget-url$="gadget_erp5_searchfield.html"] .graphic-button-section {
float: left; float: left;
} }
\ No newline at end of file
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1001.49566.12760.58282</string> </value> <value> <string>1007.6082.27095.48657</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1658784328.5</float> <float>1679004129.04</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -56,8 +56,6 @@ ...@@ -56,8 +56,6 @@
var gadget = this, var gadget = this,
i, i,
len, len,
listbox_button_class,
graphic_button_class,
only_graphic = gadget.state.only_graphic, only_graphic = gadget.state.only_graphic,
button_container = gadget.element.querySelector('div.search_parsed_value'), button_container = gadget.element.querySelector('div.search_parsed_value'),
graphic_container = gadget.element.querySelector(".graphic-button-section"), graphic_container = gadget.element.querySelector(".graphic-button-section"),
...@@ -70,12 +68,11 @@ ...@@ -70,12 +68,11 @@
sub_jio_query, sub_jio_query,
parsed_value = '', parsed_value = '',
input_value = '', input_value = '',
continue_full_text_query_search = true; continue_full_text_query_search = true,
listbox_button_class = "ui-btn-icon-notext ui-icon-list-alt switch-listbox",
if (gadget.state.enable_graphic) {
listbox_button_class = "ui-btn-icon-notext ui-icon-list-alt switch-listbox";
graphic_button_class = "ui-btn-icon-notext ui-icon-bar-chart-o switch-graph"; graphic_button_class = "ui-btn-icon-notext ui-icon-bar-chart-o switch-graph";
if (gadget.state.enable_graphic) {
if (!only_graphic) { if (!only_graphic) {
listbox_button_class = listbox_button_class + " " + hide_button_class; listbox_button_class = listbox_button_class + " " + hide_button_class;
} else if (only_graphic) { } else if (only_graphic) {
...@@ -93,7 +90,13 @@ ...@@ -93,7 +90,13 @@
}) })
]); ]);
} else { } else {
domsugar(graphic_container, []); domsugar(graphic_container, [
domsugar("button", {
"class": graphic_button_class,
"type": "button",
"disabled": true
})
]);
} }
if (gadget.state.extended_search) { if (gadget.state.extended_search) {
...@@ -272,8 +275,7 @@ ...@@ -272,8 +275,7 @@
.declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("triggerSubmit", "triggerSubmit") .declareAcquiredMethod("triggerSubmit", "triggerSubmit")
.onEvent('click', function (evt) { .onEvent('click', function (evt) {
var gadget = this, var gadget = this;
options;
if (evt.target.tagName === 'BUTTON') { if (evt.target.tagName === 'BUTTON') {
if ((evt.target.nodeType === Node.ELEMENT_NODE) && if ((evt.target.nodeType === Node.ELEMENT_NODE) &&
(evt.target.value)) { (evt.target.value)) {
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1006.59864.52244.28945</string> </value> <value> <string>1007.6115.7683.34611</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1678982211.19</float> <float>1679005696.95</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