Skip to content

Commit

Permalink
feat: add module init and VuFind obj ready events.
Browse files Browse the repository at this point in the history
  • Loading branch information
crhallberg committed May 22, 2024
1 parent a5614ea commit 575b40d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions themes/bootstrap3/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,11 @@ var VuFind = (function VuFind() {

var init = function init() {
for (var i = 0; i < _submodules.length; i++) {
if (this[_submodules[i]].init) {
this[_submodules[i]].init();
const name = _submodules[i];
const submodule = this[_submodules[i]];
if (submodule.init) {
submodule.init();
emit("init", { name, module });

Check failure on line 439 in themes/bootstrap3/js/common.js

View workflow job for this annotation

GitHub Actions / Tests with PHP 8.2

'module' is not defined
}
}
_initialized = true;
Expand Down Expand Up @@ -745,6 +748,8 @@ function setupMultiILSLoginFields(loginMethods, idPrefix) {
document.addEventListener('DOMContentLoaded', () => {
// Start up all of our submodules
VuFind.init();
VuFind.emit("ready");

// Off canvas
setupOffcanvas();

Expand Down

0 comments on commit 575b40d

Please sign in to comment.