mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
begin rework of image editor
This commit is contained in:
parent
7ea4d0b4c9
commit
5bccc1840e
53 changed files with 965 additions and 787 deletions
48
dashboard-ui/components/paperdialoghelper.js
Normal file
48
dashboard-ui/components/paperdialoghelper.js
Normal file
|
@ -0,0 +1,48 @@
|
|||
(function (globalScope) {
|
||||
|
||||
function paperDialogHashHandler(dlg, hash) {
|
||||
|
||||
function onHashChange(e, data) {
|
||||
|
||||
data = data.state;
|
||||
|
||||
if (data.direction == 'back') {
|
||||
if (dlg) {
|
||||
if (data.hash != '#' + hash) {
|
||||
dlg.close();
|
||||
dlg = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onDialogClosed() {
|
||||
|
||||
dlg = null;
|
||||
$(window).off('navigate', onHashChange);
|
||||
|
||||
if (window.location.hash == '#' + hash) {
|
||||
history.back();
|
||||
}
|
||||
}
|
||||
|
||||
var self = this;
|
||||
|
||||
$(dlg).on('iron-overlay-closed', onDialogClosed);
|
||||
dlg.open();
|
||||
|
||||
window.location.hash = hash;
|
||||
|
||||
$(window).on('navigate', onHashChange);
|
||||
}
|
||||
|
||||
function openWithHash(dlg, hash) {
|
||||
|
||||
new paperDialogHashHandler(dlg, hash);
|
||||
}
|
||||
|
||||
globalScope.PaperDialogHelper = {
|
||||
openWithHash: openWithHash
|
||||
};
|
||||
|
||||
})(this);
|
Loading…
Add table
Add a link
Reference in a new issue