summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/coresetup.js
diff options
context:
space:
mode:
authorniv-openerp <nicolas.vanhoren@openerp.com>2012-05-16 11:24:19 +0200
committerniv-openerp <nicolas.vanhoren@openerp.com>2012-05-16 11:24:19 +0200
commitac0d912e41e4e2777eef033a64ad2b2fa7253083 (patch)
tree0783c7239cc25e92ffa2561d7cc6e1e11998cb5e /addons/web/static/src/js/coresetup.js
parent399fe249f8a52ddec15b40ad526eb4e3b9fba8fc (diff)
parent742124c840b0b456c7eb48ebec753fb1303d883c (diff)
[merge]
bzr revid: nicolas.vanhoren@openerp.com-20120516092419-t3ndbvgwpxtmslmu
Diffstat (limited to 'addons/web/static/src/js/coresetup.js')
-rw-r--r--addons/web/static/src/js/coresetup.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js
index 8e7b5d4f75d..5a8a2b50722 100644
--- a/addons/web/static/src/js/coresetup.js
+++ b/addons/web/static/src/js/coresetup.js
@@ -579,6 +579,33 @@ $.async_when = function() {
return old_async_when.apply(this, arguments);
};
+/**
+ * Registry for all the client actions key: tag value: widget
+ */
+instance.web.client_actions = new instance.web.Registry();
+
+/**
+ * Client action to reload the whole interface.
+ * If params has an entry 'menu_id', it opens the given menu entry.
+ */
+instance.web.client_actions.add("reload", "instance.web.Reload");
+
+instance.web.Reload = instance.web.Widget.extend({
+ init: function(parent, params) {
+ this._super(parent);
+ this.menu_id = (params && params.menu_id) || false;
+ },
+ start: function() {
+ if (this.menu_id) {
+ // open the given menu id
+ var url_without_fragment = window.location.toString().split("#", 1)[0];
+ window.location = url_without_fragment + "#menu_id=" + this.menu_id;
+ } else {
+ window.location.reload();
+ }
+ }
+});
+
};
// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax: