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