Move reload initiation to an explicit initialize function

The reload initiation is required to run before other parts of the site
are started so that page_params will be setup correctly. This moves that
initiation out of an on ready handler to an explicit initialize call
near where the rest of the app is started.

(imported from commit b8994311299327aa3cfa57e3d9e92124a47123f4)
This commit is contained in:
Jason Michalski
2014-03-03 17:32:17 -05:00
parent f2e8929b8a
commit c753dfc9a8
2 changed files with 4 additions and 2 deletions

View File

@@ -64,9 +64,10 @@ function preserve_state(send_after_reload) {
window.location.replace(url);
}
// Check if we're doing a compose-preserving reload. This must be
// done before the first call to get_events
$(function () {
exports.initialize = function reload__initialize() {
var location = window.location.toString();
var fragment = location.substring(location.indexOf('#') + 1);
if (fragment.search("reload:") !== 0) {
@@ -121,7 +122,7 @@ $(function () {
activity.new_user_input = false;
hashchange.changehash(vars.oldhash);
});
};
function clear_message_list(msg_list) {
if (!msg_list) { return; }

View File

@@ -1474,6 +1474,7 @@ $(function () {
}
// initialize other stuff
reload.initialize();
composebox_typeahead.initialize();
search.initialize();
notifications.initialize();