From 89cc583f53c54eda8e1542a17f764543560aec1a Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 11 Dec 2017 12:48:06 +0100 Subject: [PATCH] Call the handler if onReady is called for a ready channel --- www/common/common-ui-elements.js | 4 ++-- www/common/sframe-channel.js | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index cfdb221a8..c8bb6f1c7 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1231,7 +1231,7 @@ define([ expireVal = ($('#cp-creation-expire-val').val() || 0) * unit; } - // TODO remove these lines + // XXX TODO remove these lines ownedVal = undefined; expire = undefined; @@ -1240,7 +1240,7 @@ define([ expire: expireVal, template: template }, function () { - $creation.remove(); + $creationContainer.remove(); cb(); }); }; diff --git a/www/common/sframe-channel.js b/www/common/sframe-channel.js index a091452c3..eb06af6ab 100644 --- a/www/common/sframe-channel.js +++ b/www/common/sframe-channel.js @@ -110,9 +110,13 @@ define([ chan.whenReg('EV_REGISTER_HANDLER', evReady.fire); // Make sure both iframes are ready + var isReady =false; chan.onReady = function (h) { + if (isReady) { + return void h(); + } if (typeof(h) !== "function") { return; } - chan.on('EV_RPC_READY', function () { h(); }); + chan.on('EV_RPC_READY', function () { isReady = true; h(); }); }; chan.ready = function () { chan.whenReg('EV_RPC_READY', function () {