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 @@ ...@@ -24,8 +24,7 @@
gadget_klass gadget_klass
.setState({ .setState({
visible: false, visible: false
desktop: false
}) })
////////////////////////////////////////////// //////////////////////////////////////////////
// acquired method // acquired method
...@@ -146,7 +145,6 @@ ...@@ -146,7 +145,6 @@
.push(function () { .push(function () {
context.element.querySelector("div").appendChild(tmp_element); context.element.querySelector("div").appendChild(tmp_element);
return context.listenResize();
}); });
} }
...@@ -206,11 +204,10 @@ ...@@ -206,11 +204,10 @@
} }
if ((this.state.global === true) && 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("workflow_list") ||
modification_dict.hasOwnProperty("view_list"))) { modification_dict.hasOwnProperty("view_list"))) {
if (!(this.state.desktop && (this.state.view_list !== undefined))) { if (this.state.view_list === undefined) {
queue queue
.push(function () { .push(function () {
gadget.element.querySelector("dl").textContent = ''; gadget.element.querySelector("dl").textContent = '';
...@@ -289,30 +286,6 @@ ...@@ -289,30 +286,6 @@
} }
}, false, false) }, 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) { .allowPublicAcquisition('notifyChange', function (argument_list, scope) {
if (scope === 'erp5_checkbox') { if (scope === 'erp5_checkbox') {
var context = this; var context = this;
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>964.45640.391.48230</string> </value> <value> <string>965.14666.28011.17715</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1516295067.02</float> <float>1517565753.1</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -34,10 +34,12 @@ Check that user gets notified if there is an error on a hidden field. ...@@ -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> <td>//a[@data-i18n="Views"]</td><td></td></tr>
<tr><td>click</td> <tr><td>click</td>
<td>//a[@data-i18n="Views"]</td><td></td></tr> <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> <tr><td>waitForElementPresent</td>
<td>//a[@data-i18n="View Hidden Positive-Only Quantity"]</td><td></td></tr> <td>//a[@data-i18n="View Hidden Positive-Only Quantity"]</td><td></td></tr>
<tr><td>click</td> <tr><td>click</td>
<td>//a[@data-i18n="View Hidden Positive-Only Quantity"]</td><td></td></tr> <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> <tr><td>waitForElementPresent</td>
<td>//button[@data-i18n='Save']</td><td></td></tr> <td>//button[@data-i18n='Save']</td><td></td></tr>
<tr><td>click</td> <tr><td>click</td>
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<td>//a[text()='Views']</td> <td>//a[text()='Views']</td>
<td></td> <td></td>
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//a[@data-i18n='View Crash on Save']</td> <td>//a[@data-i18n='View Crash on Save']</td>
...@@ -35,6 +36,7 @@ ...@@ -35,6 +36,7 @@
<td>//a[@data-i18n='View Crash on Save']</td> <td>//a[@data-i18n='View Crash on Save']</td>
<td></td> <td></td>
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<!-- Wait for gadget to be loaded --> <!-- Wait for gadget to be loaded -->
<tr> <tr>
<td>waitForElementPresent</td> <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