mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 08:56:10 +00:00
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:
@@ -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; }
|
||||
|
||||
@@ -1474,6 +1474,7 @@ $(function () {
|
||||
}
|
||||
|
||||
// initialize other stuff
|
||||
reload.initialize();
|
||||
composebox_typeahead.initialize();
|
||||
search.initialize();
|
||||
notifications.initialize();
|
||||
|
||||
Reference in New Issue
Block a user