Commit 386de95b authored by Sebastien Robin's avatar Sebastien Robin

do not raise error if there is no gadgets on the page

parent 4ef47e26
......@@ -549,7 +549,12 @@ $(document).ready(function () {
RenderJs.bootstrap($('body'));
}
if (RENDERJS_ENABLE_IMPLICIT_INTERACTION_BIND) {
RenderJs.GadgetIndex.getRootGadget().getDom().bind("ready",
var root_gadget = RenderJs.GadgetIndex.getRootGadget();
// We might have a page without gadgets.
// Be careful, right now we can be in this case because
// asynchronous gadget loading is not finished
if (root_gadget !== undefined) {
root_gadget.getDom().bind("ready",
function () {
// examine all Intaction Gadgets and bind accordingly
$("div[data-gadget-connection]").each( function(index, element) {
......@@ -558,4 +563,5 @@ $(document).ready(function () {
}
);
}
}
});
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