diff --git a/lib/init-widgets-browser.js b/lib/init-widgets-browser.js index 381fe18..6c06cfe 100644 --- a/lib/init-widgets-browser.js +++ b/lib/init-widgets-browser.js @@ -316,10 +316,6 @@ exports.initClientRendered = initClientRendered; * } */ exports.initServerRendered = function(dataIds) { - // Ensure that event handlers to handle delegating events are - // always attached before initializing any widgets - eventDelegation.init(); - var stateStore; var configStore; @@ -330,6 +326,10 @@ exports.initServerRendered = function(dataIds) { } function doInit() { + // Ensure that event handlers to handle delegating events are + // always attached before initializing any widgets + eventDelegation.init(); + if (typeof dataIds !== 'string') { var idsEl = document.getElementById('markoWidgets'); if (!idsEl) { // If there is no index then do nothing