page load: Make initializations more explicit.

We now initialize most modules in ui_init.js, which
isn't the perfect place to do it, but at least now
we have a mostly consolidated entry point.

All the new foo.initialize() methods introduced in
this module run the same order relative to each
other as before this commit. (I did some console
logging with a hacked version of the program to
get the order right.)  They happen a bit later than
before, though.

A couple modules still have the `$(function() {`
idiom for miscellaneous reasons:

       archive - is a different bundle
       common - used elsewhere
       list_render - non-standard code style
       scroll_bar - no exports
       setup - probably special?
       socket - $(function () is nested!
       transmit - coupled to socket
       translations - i18n is a bigger problem
       ui_init - this bootstraps everything
This commit is contained in:
Steve Howell
2018-05-15 20:03:14 +00:00
committed by Tim Abbott
parent c7731a7ebb
commit 9eb3bdaf6c
17 changed files with 56 additions and 29 deletions

View File

@@ -189,7 +189,7 @@ exports.open_settings = function () {
});
};
$(function () {
exports.initialize = function () {
$("body").on("click", ".overlay, .overlay .exit", function (e) {
var $target = $(e.target);
@@ -209,7 +209,7 @@ $(function () {
e.preventDefault();
e.stopPropagation();
});
});
};
return exports;