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