Commit f2dedaed authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Display the contextual menu also on mobile

parent 3f364b10
......@@ -24,8 +24,7 @@
gadget_klass
.setState({
visible: false,
desktop: false
visible: false
})
//////////////////////////////////////////////
// acquired method
......@@ -146,7 +145,6 @@
.push(function () {
context.element.querySelector("div").appendChild(tmp_element);
return context.listenResize();
});
}
......@@ -206,11 +204,10 @@
}
if ((this.state.global === true) &&
(modification_dict.hasOwnProperty("desktop") ||
modification_dict.hasOwnProperty("editable") ||
(modification_dict.hasOwnProperty("editable") ||
modification_dict.hasOwnProperty("workflow_list") ||
modification_dict.hasOwnProperty("view_list"))) {
if (!(this.state.desktop && (this.state.view_list !== undefined))) {
if (this.state.view_list === undefined) {
queue
.push(function () {
gadget.element.querySelector("dl").textContent = '';
......@@ -289,30 +286,6 @@
}
}, false, false)
.declareJob('listenResize', function () {
// resize should be only trigger after the render method
// as displaying the panel rely on external gadget (for translation for example)
var result,
event,
context = this;
function extractSizeAndDispatch() {
if (window.matchMedia("(min-width: 85em)").matches) {
return context.changeState({
desktop: true
});
}
return context.changeState({
desktop: false
});
}
result = loopEventListener(window, 'resize', false,
extractSizeAndDispatch);
event = document.createEvent("Event");
event.initEvent('resize', true, true);
window.dispatchEvent(event);
return result;
})
.allowPublicAcquisition('notifyChange', function (argument_list, scope) {
if (scope === 'erp5_checkbox') {
var context = this;
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.45640.391.48230</string> </value>
<value> <string>965.14666.28011.17715</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1516295067.02</float>
<float>1517565753.1</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -34,10 +34,12 @@ Check that user gets notified if there is an error on a hidden field.
<td>//a[@data-i18n="Views"]</td><td></td></tr>
<tr><td>click</td>
<td>//a[@data-i18n="Views"]</td><td></td></tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr><td>waitForElementPresent</td>
<td>//a[@data-i18n="View Hidden Positive-Only Quantity"]</td><td></td></tr>
<tr><td>click</td>
<td>//a[@data-i18n="View Hidden Positive-Only Quantity"]</td><td></td></tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr><td>waitForElementPresent</td>
<td>//button[@data-i18n='Save']</td><td></td></tr>
<tr><td>click</td>
......
......@@ -25,6 +25,7 @@
<td>//a[text()='Views']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='View Crash on Save']</td>
......@@ -35,6 +36,7 @@
<td>//a[@data-i18n='View Crash on Save']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<!-- Wait for gadget to be loaded -->
<tr>
<td>waitForElementPresent</td>
......
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