mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
make scripts more modular
This commit is contained in:
parent
284e61038d
commit
ce35317652
11 changed files with 109 additions and 86 deletions
|
@ -1824,6 +1824,36 @@ $(document).on('pagecreate', ".page", function () {
|
|||
$(document.body).addClass('removeScrollbars');
|
||||
}
|
||||
|
||||
}).on('pageinit', ".page", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
var require = this.getAttribute('data-require');
|
||||
|
||||
if (require) {
|
||||
requirejs([require], function() {
|
||||
|
||||
$(page).trigger('pageinitdepends');
|
||||
});
|
||||
} else {
|
||||
$(page).trigger('pageinitdepends');
|
||||
}
|
||||
|
||||
}).on('pageshow', ".page", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
var require = this.getAttribute('data-require');
|
||||
|
||||
if (require) {
|
||||
requirejs([require], function () {
|
||||
|
||||
$(page).trigger('pageshown');
|
||||
});
|
||||
} else {
|
||||
$(page).trigger('pageshown');
|
||||
}
|
||||
|
||||
}).on('pagebeforeshow', ".page", function () {
|
||||
|
||||
var page = $(this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue