summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/core/widget.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/addons/web/static/src/js/core/widget.js b/addons/web/static/src/js/core/widget.js
index a089f8876fe..8b827147450 100644
--- a/addons/web/static/src/js/core/widget.js
+++ b/addons/web/static/src/js/core/widget.js
@@ -214,13 +214,17 @@ var Widget = core.Class.extend(mixins.PropertiesMixin, ServicesMixin, {
* Hides the widget
*/
do_hide: function () {
- this.$el.addClass('o_hidden');
+ if (this.$el) {
+ this.$el.addClass('o_hidden');
+ }
},
/**
* Displays the widget
*/
do_show: function () {
- this.$el.removeClass('o_hidden');
+ if (this.$el) {
+ this.$el.removeClass('o_hidden');
+ }
},
/**
* Displays or hides the widget
@@ -229,7 +233,7 @@ var Widget = core.Class.extend(mixins.PropertiesMixin, ServicesMixin, {
do_toggle: function (display) {
if (_.isBoolean(display)) {
display ? this.do_show() : this.do_hide();
- } else {
+ } else if (this.$el) {
this.$el.hasClass('o_hidden') ? this.do_show() : this.do_hide();
}
},