summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Lejeune <sle@openerp.com>2015-07-22 11:10:45 +0200
committerSimon Lejeune <sle@openerp.com>2015-07-23 14:02:40 +0200
commit74c5f772f3d6debf7e791c703a5ee31cf3fb39a3 (patch)
tree74d974d49273866fd4c3d01b5a224a07ce764c30
parentb5967cc071f344ea5c5e565884d4fd5b0d5885dd (diff)
[ADD] web: framework: do_toggle on widget
-rw-r--r--addons/web/static/src/js/framework/widget.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/addons/web/static/src/js/framework/widget.js b/addons/web/static/src/js/framework/widget.js
index 6d2a3728ed8..6dbb1294ee7 100644
--- a/addons/web/static/src/js/framework/widget.js
+++ b/addons/web/static/src/js/framework/widget.js
@@ -352,6 +352,13 @@ var Widget = core.Class.extend(mixins.PropertiesMixin, {
do_hide: function () {
this.$el.addClass('o_hidden');
},
+ do_toggle: function () {
+ if (this.$el.hasClass('o_hidden')) {
+ this.do_show();
+ } else {
+ this.do_hide();
+ }
+ },
/**
* Proxies a method of the object, in order to keep the right ``this`` on
* method invocations.
@@ -403,4 +410,4 @@ var Widget = core.Class.extend(mixins.PropertiesMixin, {
return Widget;
-}); \ No newline at end of file
+});