Skip to content
Snippets Groups Projects
Commit 74c5f772 authored by Simon Lejeune's avatar Simon Lejeune
Browse files

[ADD] web: framework: do_toggle on widget

parent b5967cc0
No related branches found
No related tags found
No related merge requests found
......@@ -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
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment