From ca95167da1fe5fa1ef76e480d1553ef65d5b843c Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Fri, 3 May 2013 16:12:58 -0400 Subject: [PATCH] Move several initialization calls to after we've set up event handlers. This will matter shortly as hashchange.initialize can call narrow.activate(), which fires an event handler. Really, I have no idea why we have these initialize() methods anyway and we don't just do initialization on document.ready. (imported from commit 3a6a80e1426b03439b95cae3f142a4b1c43125e9) --- zephyr/static/js/ui.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/zephyr/static/js/ui.js b/zephyr/static/js/ui.js index 6c95012bbc..d71bf6cb4f 100644 --- a/zephyr/static/js/ui.js +++ b/zephyr/static/js/ui.js @@ -833,16 +833,6 @@ $(function () { resizehandler(); hack_for_floating_recipient_bar(); - typeahead_helper.update_all_recipients(page_params.people_list); - composebox_typeahead.initialize(); - search.initialize(); - notifications.initialize(); - hashchange.initialize(); - invite.initialize(); - activity.initialize(); - subs.maybe_toggle_all_messages(); - tutorial.initialize(); - $("#main_div").on("click", ".messagebox", function (e) { var target = $(e.target); if (target.is("a") || target.is("img.message_inline_image") || target.is("img.twitter-avatar") || @@ -1125,6 +1115,16 @@ $(function () { } }); + // initialize other stuff + typeahead_helper.update_all_recipients(page_params.people_list); + composebox_typeahead.initialize(); + search.initialize(); + notifications.initialize(); + hashchange.initialize(); + invite.initialize(); + activity.initialize(); + subs.maybe_toggle_all_messages(); + tutorial.initialize(); }); exports.sort_narrow_list = function () {