diff options
| author | Jeremy Kersten <jke@odoo.com> | 2017-06-28 14:36:08 +0200 |
|---|---|---|
| committer | Jeremy Kersten <jke@odoo.com> | 2017-06-28 14:36:11 +0200 |
| commit | 32423169af0a4dcd38398e4ad4f630faccba4ff8 (patch) | |
| tree | e420803b093a49313ecff4914adc3bc47edd94f6 /addons/web/static/src/js/apps.js | |
| parent | 2b2be3caa43bf2d0924e5742c6e3330477644971 (diff) | |
[FIX] web: namespace the event for Apps Widget.
With the new client web from v9, we start the new action before to destroy the old one.
When we switch from Apps (store) to Update and vice-versa, iframe was not loaded correctly.
In case of the Apps widget, we are binding event of the new iframe during the start,
and when it is ready, we destroy the old ifram and so unbind the listener of 'message.apps'.
Using a uniq id, we ensure to bind new event, and only unbind old event during the destroy.
Diffstat (limited to 'addons/web/static/src/js/apps.js')
| -rw-r--r-- | addons/web/static/src/js/apps.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/addons/web/static/src/js/apps.js b/addons/web/static/src/js/apps.js index 156fe9e10b7..69993dcc0ef 100644 --- a/addons/web/static/src/js/apps.js +++ b/addons/web/static/src/js/apps.js @@ -62,7 +62,7 @@ var Apps = Widget.extend({ }, destroy: function() { - $(window).off("message.apps"); + $(window).off("message." + this.uniq); if (this.$ifr) { this.$ifr.remove(); this.$ifr = null; @@ -114,10 +114,12 @@ var Apps = Widget.extend({ var qs = (session.debug ? 'debug&' : '') + 'db=' + client.dbname; var u = client.origin + '/apps/embed/client?' + qs; - var css = {width: '100%', height: '400px'}; + + var css = {width: '100%', height: '750px'}; self.$ifr = $('<iframe>').attr('src', u); - $(window).on("message.apps", self.proxy('_on_message')); + self.uniq = _.uniqueId('apps'); + $(window).on("message." + self.uniq, self.proxy('_on_message')); self.on('message:ready', self, function(m) { var w = this.$ifr[0].contentWindow; |
