Commit 9974e56d authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Router: add store_and_display command

parent deb1f750
......@@ -32,6 +32,8 @@
COMMAND_CHANGE_STATE = "change",
// Like change, but also store the current jio document display state
COMMAND_STORE_AND_CHANGE_STATE = "store_and_change",
// Like display, but also store the current jio document display state
COMMAND_STORE_AND_DISPLAY_STATE = "store_and_display",
// Display one entry index from a selection
COMMAND_INDEX_STATE = "index",
// Display previous entry index from a selection
......@@ -52,6 +54,7 @@
VALID_URL_COMMAND_DICT[COMMAND_DISPLAY_STORED_STATE] = null;
VALID_URL_COMMAND_DICT[COMMAND_CHANGE_STATE] = null;
VALID_URL_COMMAND_DICT[COMMAND_STORE_AND_CHANGE_STATE] = null;
VALID_URL_COMMAND_DICT[COMMAND_STORE_AND_DISPLAY_STATE] = null;
VALID_URL_COMMAND_DICT[COMMAND_INDEX_STATE] = null;
VALID_URL_COMMAND_DICT[COMMAND_SELECTION_PREVIOUS] = null;
VALID_URL_COMMAND_DICT[COMMAND_SELECTION_NEXT] = null;
......@@ -336,12 +339,10 @@
);
}
function execStoreAndChangeCommand(gadget, previous_options, next_options, drop_options) {
var options,
jio_key,
function execStoreAndDisplayCommand(gadget, options) {
var jio_key,
queue,
display_url;
options = calculateChangeOptions(previous_options, next_options, drop_options);
jio_key = options.jio_key;
delete options.jio_key;
......@@ -360,6 +361,13 @@
});
}
function execStoreAndChangeCommand(gadget, previous_options, next_options, drop_options) {
return execStoreAndDisplayCommand(
gadget,
calculateChangeOptions(previous_options, next_options, drop_options)
);
}
function execIndexCommand(gadget, previous_options, next_options) {
var jio_key = next_options.jio_key,
selection_options = {};
......@@ -753,6 +761,9 @@
if (command_options.path === COMMAND_STORE_AND_CHANGE_STATE) {
return execStoreAndChangeCommand(gadget, previous_options, next_options, drop_options);
}
if (command_options.path === COMMAND_STORE_AND_DISPLAY_STATE) {
return execStoreAndDisplayCommand(gadget, next_options);
}
if (command_options.path === COMMAND_SELECTION_NEXT) {
return execSelectionNextCommand(gadget, previous_options);
}
......
......@@ -232,7 +232,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.44610.27477.10598</string> </value>
<value> <string>965.29255.31672.17100</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -250,7 +250,7 @@
</tuple>
<state>
<tuple>
<float>1515687403.54</float>
<float>1518440166.69</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