From 32423169af0a4dcd38398e4ad4f630faccba4ff8 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Wed, 28 Jun 2017 14:36:08 +0200 Subject: [PATCH 1/2] [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. --- addons/web/static/src/js/apps.js | 8 +++++--- 1 file 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 = $('