mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Remove MetadataEditor global
This commit is contained in:
parent
8cc88fb08c
commit
9c6ea4b525
3 changed files with 11 additions and 21 deletions
|
@ -1,5 +1,5 @@
|
|||
import loading from '../components/loading/loading';
|
||||
import '../scripts/editorsidebar';
|
||||
import loading from 'components/loading/loading';
|
||||
import { getCurrentItemId, setCurrentItemId } from 'scripts/editorsidebar';
|
||||
|
||||
function reload(context, itemId) {
|
||||
loading.show();
|
||||
|
@ -16,14 +16,16 @@ function reload(context, itemId) {
|
|||
|
||||
export default function (view) {
|
||||
view.addEventListener('viewshow', function () {
|
||||
reload(this, MetadataEditor.getCurrentItemId());
|
||||
reload(this, getCurrentItemId());
|
||||
});
|
||||
MetadataEditor.setCurrentItemId(null);
|
||||
|
||||
setCurrentItemId(null);
|
||||
|
||||
view.querySelector('.libraryTree').addEventListener('itemclicked', function (event) {
|
||||
const data = event.detail;
|
||||
|
||||
if (data.id != MetadataEditor.getCurrentItemId()) {
|
||||
MetadataEditor.setCurrentItemId(data.id);
|
||||
if (data.id != getCurrentItemId()) {
|
||||
setCurrentItemId(data.id);
|
||||
reload(view, data.id);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue