From cc1a521d7013dac416698301de0269f712c93f4f Mon Sep 17 00:00:00 2001 From: emagdalena Date: Mon, 14 Oct 2019 12:38:54 +0200 Subject: [PATCH] [FIX] web_dialog_size js warnings --- .../static/src/js/web_dialog_size.js | 108 +++++++++--------- .../static/src/js/ribbon.js | 2 +- web_responsive/__manifest__.py | 2 +- 3 files changed, 58 insertions(+), 54 deletions(-) diff --git a/web_dialog_size/static/src/js/web_dialog_size.js b/web_dialog_size/static/src/js/web_dialog_size.js index 63b6af62bc20..e13aa88eaa06 100644 --- a/web_dialog_size/static/src/js/web_dialog_size.js +++ b/web_dialog_size/static/src/js/web_dialog_size.js @@ -1,66 +1,70 @@ odoo.define('web_dialog_size.web_dialog_size', function (require) { -'use strict'; + 'use strict'; -var rpc = require('web.rpc'); -var Dialog = require('web.Dialog'); + var rpc = require('web.rpc'); + var Dialog = require('web.Dialog'); -var config = rpc.query({ - model: 'ir.config_parameter', - method: 'get_web_dialog_size_config', -}); + var config = rpc.query({ + model: 'ir.config_parameter', + method: 'get_web_dialog_size_config', + }); -Dialog.include({ + Dialog.include({ - willStart: function () { - var self = this; - return this._super.apply(this, arguments).then(function () { - self.$modal.find('.dialog_button_extend').on('click', self.proxy('_extending')); - self.$modal.find('.dialog_button_restore').on('click', self.proxy('_restore')); - return config.then(function(r) { - if (r.default_maximize) { - self._extending(); - } else { - self._restore(); - } + willStart: function () { + var self = this; + return this._super.apply(this, arguments).then(function () { + self.$modal.find('.dialog_button_extend').on('click', + self.proxy('_extending') + ); + self.$modal.find('.dialog_button_restore').on('click', + self.proxy('_restore') + ); + return config.then(function (r) { + if (r.default_maximize) { + self._extending(); + } else { + self._restore(); + } + }); }); - }); - }, + }, - opened: function(handler) { - return this._super.apply(this, arguments).then(function(){ - if (this.$modal) { - this.$modal.draggable({ - handle: '.modal-header', - helper: false - }); - } - }.bind(this)); - }, + opened: function () { + return this._super.apply(this, arguments).then(function () { + if (this.$modal) { + this.$modal.draggable({ + handle: '.modal-header', + helper: false, + }); + } + }.bind(this)); + }, - close: function() { - if (this.$modal) { - var draggable = this.$modal.draggable("instance"); - if (draggable) { - this.$modal.draggable("destroy"); + close: function () { + if (this.$modal) { + var draggable = this.$modal.draggable("instance"); + if (draggable) { + this.$modal.draggable("destroy"); + } } - } - return this._super.apply(this, arguments); - }, + return this._super.apply(this, arguments); + }, - _extending: function() { - var dialog = this.$modal.find('.modal-dialog'); - dialog.addClass('dialog_full_screen'); - dialog.find('.dialog_button_extend').hide(); - dialog.find('.dialog_button_restore').show(); - }, + _extending: function () { + var dialog = this.$modal.find('.modal-dialog'); + dialog.addClass('dialog_full_screen'); + dialog.find('.dialog_button_extend').hide(); + dialog.find('.dialog_button_restore').show(); + }, - _restore: function() { - var dialog = this.$modal.find('.modal-dialog'); - dialog.removeClass('dialog_full_screen'); - dialog.find('.dialog_button_restore').hide(); - dialog.find('.dialog_button_extend').show(); - }, + _restore: function () { + var dialog = this.$modal.find('.modal-dialog'); + dialog.removeClass('dialog_full_screen'); + dialog.find('.dialog_button_restore').hide(); + dialog.find('.dialog_button_extend').show(); + }, -}); + }); }); diff --git a/web_environment_ribbon/static/src/js/ribbon.js b/web_environment_ribbon/static/src/js/ribbon.js index fd86ce495625..cbd6fa37c712 100644 --- a/web_environment_ribbon/static/src/js/ribbon.js +++ b/web_environment_ribbon/static/src/js/ribbon.js @@ -53,7 +53,7 @@ odoo.define('web_environment_ribbon.ribbon', function (require) { ribbon.css('color', ribbon_data.color); } // Ribbon background color - if (ribbon_data.background_color && + if (ribbon_data.background_color && validStrColour(ribbon_data.background_color)) { ribbon.css('background-color', ribbon_data.background_color); } diff --git a/web_responsive/__manifest__.py b/web_responsive/__manifest__.py index 6e93022bfb16..2720cb2d4af0 100644 --- a/web_responsive/__manifest__.py +++ b/web_responsive/__manifest__.py @@ -14,7 +14,7 @@ "installable": True, "depends": ["web", "mail"], "development_status": "Production/Stable", - "maintainers": ['Yajo', 'Tardo'], + "maintainers": ["Yajo", "Tardo"], "data": ["views/assets.xml", "views/res_users.xml", "views/web.xml"], "qweb": [ "static/src/xml/apps.xml",