mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-23 00:29:22 +09:00
enhance(client): photoswipe 表示時に戻る操作をしても前の画面に戻らないように (#10098)
* enhance(client): photoswipe 表示時に戻る操作をしても前の画面に戻らないように * add: changelog --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
parent
60342ed3fa
commit
72888b4814
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
### Improvements
|
### Improvements
|
||||||
- feat: 検索画面の統合 (Khsmty)
|
- feat: 検索画面の統合 (Khsmty)
|
||||||
|
- photoswipe 表示時に戻る操作をしても前の画面に戻らないように
|
||||||
|
|
||||||
### Bugfixes
|
### Bugfixes
|
||||||
-
|
-
|
||||||
|
@ -113,6 +113,23 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
lightbox.init();
|
lightbox.init();
|
||||||
|
|
||||||
|
window.addEventListener('popstate', () => {
|
||||||
|
if (lightbox.pswp && lightbox.pswp.isOpen === true) {
|
||||||
|
lightbox.pswp.close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
lightbox.on('beforeOpen', () => {
|
||||||
|
history.pushState(null, '', '#pswp');
|
||||||
|
});
|
||||||
|
|
||||||
|
lightbox.on('close', () => {
|
||||||
|
if (window.location.hash === '#pswp') {
|
||||||
|
history.back();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const previewable = (file: misskey.entities.DriveFile): boolean => {
|
const previewable = (file: misskey.entities.DriveFile): boolean => {
|
||||||
|
Loading…
Reference in New Issue
Block a user