Commit 201fdb09 authored by Romain Courteaud's avatar Romain Courteaud

Clearing gadget internal parameters can be done synchronously.

parent b9e4d9a8
...@@ -492,9 +492,9 @@ ...@@ -492,9 +492,9 @@
}).fail(letsCrash); }).fail(letsCrash);
} }
function clearGadgetInternalParameters() { function clearGadgetInternalParameters(gadget) {
this.__sub_gadget_dict = {}; gadget.__sub_gadget_dict = {};
createGadgetMonitor(this); createGadgetMonitor(gadget);
} }
function loadSubGadgetDOMDeclaration() { function loadSubGadgetDOMDeclaration() {
...@@ -539,8 +539,7 @@ ...@@ -539,8 +539,7 @@
return RSVP.all(promise_list); return RSVP.all(promise_list);
} }
RenderJSGadget.__ready_list = [clearGadgetInternalParameters, RenderJSGadget.__ready_list = [loadSubGadgetDOMDeclaration];
loadSubGadgetDOMDeclaration];
RenderJSGadget.ready = function ready(callback) { RenderJSGadget.ready = function ready(callback) {
this.__ready_list.push(callback); this.__ready_list.push(callback);
return this; return this;
...@@ -1075,6 +1074,7 @@ ...@@ -1075,6 +1074,7 @@
var i, var i,
scope, scope,
queue = new RSVP.Queue(); queue = new RSVP.Queue();
clearGadgetInternalParameters(gadget_instance);
// Trigger calling of all ready callback // Trigger calling of all ready callback
function ready_wrapper() { function ready_wrapper() {
return gadget_instance; return gadget_instance;
...@@ -1812,6 +1812,7 @@ ...@@ -1812,6 +1812,7 @@
return configureMutationObserver(TmpConstructor, url, root_gadget); return configureMutationObserver(TmpConstructor, url, root_gadget);
}) })
.push(function waitForReadyList() { .push(function waitForReadyList() {
clearGadgetInternalParameters(root_gadget);
// Trigger all ready functions // Trigger all ready functions
return triggerReadyList(TmpConstructor, root_gadget); return triggerReadyList(TmpConstructor, root_gadget);
}) })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment