diff options
| author | Aaron Bohy <aab@odoo.com> | 2018-03-05 15:11:12 +0100 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2018-03-05 16:11:04 +0100 |
| commit | a34357275fe731634c45ea07607f744d8c44b36e (patch) | |
| tree | 8723bc61fbb0cab20a4947fae35968aa9517a05c /addons/web/static/src/js/widgets/notification.js | |
| parent | c410911ad93ed970f94fc546c0109bf1b48a6f14 (diff) | |
[FIX] web: bug introduced by forwardport 36945a58
PhantomJS doesn't like widgets that define two start functions.
Diffstat (limited to 'addons/web/static/src/js/widgets/notification.js')
| -rw-r--r-- | addons/web/static/src/js/widgets/notification.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/addons/web/static/src/js/widgets/notification.js b/addons/web/static/src/js/widgets/notification.js index 2d987944d30..d05a0be380c 100644 --- a/addons/web/static/src/js/widgets/notification.js +++ b/addons/web/static/src/js/widgets/notification.js @@ -34,7 +34,8 @@ var Notification = Widget.extend({ this.title = params.title; this.text = params.text; this.sticky = !!params.sticky; - if (params.type === 'warning') { + this.type = params.type; + if (this.type === 'warning') { this.template = 'Warning'; } }, @@ -43,6 +44,9 @@ var Notification = Widget.extend({ */ start: function () { var self = this; + if (this.type === 'warning') { + this.$el.addClass('o_error'); + } return this._super.apply(this, arguments).then(function () { self.$el.animate({opacity: 1.0}, 400, "swing", function () { if(!self.sticky) { @@ -68,13 +72,6 @@ var Notification = Widget.extend({ self.$el.animate({height: 0}, 400, "swing", self.destroy.bind(self)); }); }, - /** - * @override - */ - start: function () { - this.$el.addClass('o_error'); - return this._super.apply(this, arguments); - }, //-------------------------------------------------------------------------- // Handlers |
