Commit 7d59d147 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Force editable on desktop

parent 0b819055
...@@ -374,6 +374,10 @@ ...@@ -374,6 +374,10 @@
]); ]);
}) })
.allowPublicAcquisition('isDesktopMedia', function (argument_list) {
return window.matchMedia("(min-width: 85em)").matches;
})
.allowPublicAcquisition('refresh', function () { .allowPublicAcquisition('refresh', function () {
var gadget = this; var gadget = this;
return gadget.getDeclaredGadget(MAIN_SCOPE) return gadget.getDeclaredGadget(MAIN_SCOPE)
......
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>vincent</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -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.44401.33443.35072</string> </value> <value> <string>965.3167.36247.3959</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>1516619185.21</float> <float>1519038006.66</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -639,9 +639,20 @@ ...@@ -639,9 +639,20 @@
// Nothing. Go to front page // Nothing. Go to front page
// If no frontpage is configured, his may comes from missing configuration on website // If no frontpage is configured, his may comes from missing configuration on website
// or default HTML gadget modification date more recent than the website modification date // or default HTML gadget modification date more recent than the website modification date
return gadget.getSetting("frontpage_gadget") return new RSVP.Queue()
.push(function (result) { .push(function () {
var options = {page: result}; return RSVP.all([
gadget.getSetting("frontpage_gadget"),
gadget.isDesktopMedia()
]);
})
.push(function (result_list) {
var options = {page: result_list[0]};
if (result_list[1]) {
// When displayed on a desktop, force the UI
// to be in editable mode by default
options.editable = true;
}
if (previous_options === undefined) { if (previous_options === undefined) {
previous_options = {}; previous_options = {};
} }
...@@ -1044,6 +1055,7 @@ ...@@ -1044,6 +1055,7 @@
.declareAcquiredMethod('getSetting', 'getSetting') .declareAcquiredMethod('getSetting', 'getSetting')
.declareAcquiredMethod('renderError', 'reportServiceError') .declareAcquiredMethod('renderError', 'reportServiceError')
.declareAcquiredMethod('translate', 'translate') .declareAcquiredMethod('translate', 'translate')
.declareAcquiredMethod('isDesktopMedia', 'isDesktopMedia')
.declareJob('listenHashChange', function () { .declareJob('listenHashChange', function () {
return listenHashChange(this); return listenHashChange(this);
......
...@@ -232,7 +232,7 @@ ...@@ -232,7 +232,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.29272.2871.14455</string> </value> <value> <string>965.39308.13571.6894</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1518441236.24</float> <float>1519043897.55</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