-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33940/
-----------------------------------------------------------
(Updated May 7, 2015, 5:35 p.m.)
Review request for shindig, Ryan Baxter and Stanton Sievers.
Bugs: SHINDIG-1994
https://issues.apache.org/jira/browse/SHINDIG-1994
Repository: shindig
Description
-------
The callback on gadget_site:navigateTo was being called without waiting for the
setModuleId_ call to complete.
Diffs (updated)
-----
trunk/features/src/main/javascript/features/container.site.gadget/gadget_site.js
1642996
Diff: https://reviews.apache.org/r/33940/diff/
Testing
-------
Use the following code to test:
<html><body onload="init();"></body></html>
<script type="text/javascript"
src="../../../gadgets/js/container.js?c=1&debug=1&container=default"></script>
<script type="text/javascript">
function init() {
var gadgetXml =
'https://dl.dropboxusercontent.com/u/445894/gadgets/settitle.xml';
var container = new osapi.container.Container({});
var div = document.createElement("div");
document.body.appendChild(div);
var gadgetSite = container.newGadgetSite(div);
var renderParams = {};
renderParams[osapi.container.RenderParam.MODULE_ID] = 1;
container.navigateGadget(gadgetSite, gadgetXml, {}, renderParams,
function(){
// log active site immediately (undefined)
console.log("activeSiteHolder1=" +
gadgetSite.getActiveSiteHolder());
// log active site 1 second later (now has a value)
setTimeout(function() {
console.log("activeSiteHolder2=" +
gadgetSite.getActiveSiteHolder());
}, 1000);
});
}
</script>
Thanks,
Doug Davies