From 63d86eb9ebb14ab92975328597bb3d3079335c95 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 1 Oct 2013 13:53:26 -0400 Subject: [PATCH] FIX: Allow Spoiler plugin (and others that use prototype.on) to work even if ListView was not initialized. --- app/assets/javascripts/discourse.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse.js b/app/assets/javascripts/discourse.js index 8927da3ac41..4b845c4c88c 100644 --- a/app/assets/javascripts/discourse.js +++ b/app/assets/javascripts/discourse.js @@ -236,8 +236,11 @@ Discourse = Ember.Application.createWithMixins(Discourse.Ajax, { Discourse.subscribeUserToNotifications(); if (Discourse.initializers) { - Discourse.initializers.forEach(function (init) { - init.call(this); + var self = this; + Em.run.next(function() { + Discourse.initializers.forEach(function (init) { + init.call(self); + }); }); } }