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)
This commit is contained in:
Zev Benjamin
2013-05-03 16:12:58 -04:00
committed by Tim Abbott
parent 43829b4288
commit ca95167da1

View File

@@ -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 () {