Skip to content

Commit

Permalink
Fixes #154 - Fix event attaching by ensuring that DOM is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-steele-idem committed Sep 6, 2016
1 parent 3b5c037 commit 514fb2d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/init-widgets-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down

0 comments on commit 514fb2d

Please sign in to comment.