diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-04-01 16:20:00 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-04-01 16:20:00 +0200 |
| commit | 7ac5ec628cb9fe8ff3f6b54a1466f246a24ff01c (patch) | |
| tree | e9297c876e0f9886c1b0abbb7e5cd389a7ab708c /addons/web/static/src/js | |
| parent | 8de362fac65867687a3eb0557012db75faeab850 (diff) | |
| parent | 18c735361a6861a294a9dc254395a084eb42f505 (diff) | |
[MERGE] forward port branch saas-12.2 up to 18c735361a6
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/chrome/abstract_action.js | 10 | ||||
| -rw-r--r-- | addons/web/static/src/js/core/dialog.js | 10 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/calendar/calendar_model.js | 6 |
3 files changed, 14 insertions, 12 deletions
diff --git a/addons/web/static/src/js/chrome/abstract_action.js b/addons/web/static/src/js/chrome/abstract_action.js index 1b258ccc6f6..cf85a278884 100644 --- a/addons/web/static/src/js/chrome/abstract_action.js +++ b/addons/web/static/src/js/chrome/abstract_action.js @@ -91,20 +91,20 @@ var AbstractAction = Widget.extend(ActionMixin, { */ willStart: function () { var self = this; + var defs = [this._super.apply(this, arguments)]; if (this.hasControlPanel) { var params = this.controlPanelParams; - var def; if (this.loadControlPanel) { - def = this + defs.push(this .loadFieldView(params.modelName, params.context || {}, params.viewId, 'search') .then(function (fieldsView) { params.viewInfo = { arch: fieldsView.arch, fields: fieldsView.fields, }; - }); + })); } - return Promise.resolve(def).then(function () { + return Promise.all(defs).then(function () { var controlPanelView = new self.config.ControlPanelView(params); return controlPanelView.getController(self).then(function (controlPanel) { self._controlPanel = controlPanel; @@ -112,7 +112,7 @@ var AbstractAction = Widget.extend(ActionMixin, { }); }); } - return Promise.resolve(); + return Promise.all(defs); }, /** * @override diff --git a/addons/web/static/src/js/core/dialog.js b/addons/web/static/src/js/core/dialog.js index 8630b6b9364..807411144e9 100644 --- a/addons/web/static/src/js/core/dialog.js +++ b/addons/web/static/src/js/core/dialog.js @@ -231,13 +231,13 @@ var Dialog = Widget.extend({ this.$modal.remove(); } - if (!isFocusSet) { - var modals = $('body > .modal').filter(':visible'); - if (modals.length) { + var modals = $('body > .modal').filter(':visible'); + if (modals.length) { + if (!isFocusSet) { modals.last().focus(); - // Keep class modal-open (deleted by bootstrap hide fnct) on body to allow scrolling inside the modal - $('body').addClass('modal-open'); } + // Keep class modal-open (deleted by bootstrap hide fnct) on body to allow scrolling inside the modal + $('body').addClass('modal-open'); } }, /** diff --git a/addons/web/static/src/js/views/calendar/calendar_model.js b/addons/web/static/src/js/views/calendar/calendar_model.js index 9d8cf04f30f..1bcf4fbb298 100644 --- a/addons/web/static/src/js/views/calendar/calendar_model.js +++ b/addons/web/static/src/js/views/calendar/calendar_model.js @@ -75,9 +75,11 @@ return AbstractModel.extend({ .utc(); } else { // default hours in the user's timezone - start.hours(7).add(-this.getSession().getTZOffset(start), 'minutes'); - end.hours(19).add(-this.getSession().getTZOffset(end), 'minutes'); + start.hours(7); + end.hours(19); } + start.add(-this.getSession().getTZOffset(start), 'minutes'); + end.add(-this.getSession().getTZOffset(end), 'minutes'); } } else { start.add(-this.getSession().getTZOffset(start), 'minutes'); |
