Commit cd9bbb5c authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_web_renderjs_ui: hide or deactivate the button properly

parent f69ee075
......@@ -72,31 +72,35 @@
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) {
graphic_button_class = graphic_button_class + " " + hide_button_class;
}
if (gadget.state.hasOwnProperty("enable_graphic")) {
if (gadget.state.enable_graphic) {
if (!only_graphic) {
listbox_button_class = listbox_button_class + " " + hide_button_class;
} else if (only_graphic) {
graphic_button_class = graphic_button_class + " " + hide_button_class;
}
domsugar(graphic_container, [
domsugar("button", {
"class": listbox_button_class,
"type": "button"
}),
domsugar("button", {
"class": graphic_button_class,
"type": "button"
})
]);
domsugar(graphic_container, [
domsugar("button", {
"class": listbox_button_class,
"type": "button"
}),
domsugar("button", {
"class": graphic_button_class,
"type": "button"
})
]);
} else {
domsugar(graphic_container, [
domsugar("button", {
"class": graphic_button_class,
"type": "button",
"disabled": true
})
]);
}
} else {
domsugar(graphic_container, [
domsugar("button", {
"class": graphic_button_class,
"type": "button",
"disabled": true
})
]);
domsugar(graphic_container, []);
}
if (gadget.state.extended_search) {
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1007.6115.7683.34611</string> </value>
<value> <string>1007.7357.22099.45977</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>1679005696.95</float>
<float>1679080300.57</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