mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add autofocus on page load
This commit is contained in:
parent
e588edbcca
commit
472d391641
4 changed files with 29 additions and 0 deletions
|
@ -1715,6 +1715,12 @@ define(["loading", "appRouter", "layoutManager", "connectionManager", "cardBuild
|
||||||
hideAll(page, "btnPlay", false);
|
hideAll(page, "btnPlay", false);
|
||||||
hideAll(page, "btnShuffle", false);
|
hideAll(page, "btnShuffle", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// HACK: Call autoFocuser again because btnPlay may be hidden, but focused by reloadFromItem
|
||||||
|
// FIXME: Sometimes focus does not move until all (?) sections are loaded
|
||||||
|
require(["autoFocuser"], function (autoFocuser) {
|
||||||
|
autoFocuser.autoFocus(page);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderCollectionItemType(page, parentItem, type, items) {
|
function renderCollectionItemType(page, parentItem, type, items) {
|
||||||
|
|
|
@ -102,6 +102,10 @@ define(["cardBuilder", "imageLoader", "libraryBrowser", "loading", "events", "em
|
||||||
renderChannels(context, result);
|
renderChannels(context, result);
|
||||||
loading.hide();
|
loading.hide();
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
|
|
||||||
|
require(["autoFocuser"], function (autoFocuser) {
|
||||||
|
autoFocuser.autoFocus(view);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,10 @@ define(["layoutManager", "userSettings", "inputManager", "loading", "globalize",
|
||||||
showAirEndTime: true
|
showAirEndTime: true
|
||||||
});
|
});
|
||||||
loading.hide();
|
loading.hide();
|
||||||
|
|
||||||
|
require(["autoFocuser"], function (autoFocuser) {
|
||||||
|
autoFocuser.autoFocus(page);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,9 @@ define(["events", "layoutManager", "inputManager", "userSettings", "libraryMenu"
|
||||||
showYear: true,
|
showYear: true,
|
||||||
centerText: true
|
centerText: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// FIXME: Wait for all sections to load
|
||||||
|
autoFocus(page);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,6 +79,9 @@ define(["events", "layoutManager", "inputManager", "userSettings", "libraryMenu"
|
||||||
showYear: true,
|
showYear: true,
|
||||||
centerText: true
|
centerText: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// FIXME: Wait for all sections to load
|
||||||
|
autoFocus(page);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,6 +153,15 @@ define(["events", "layoutManager", "inputManager", "userSettings", "libraryMenu"
|
||||||
var recs = page.querySelector(".recommendations");
|
var recs = page.querySelector(".recommendations");
|
||||||
recs.innerHTML = html;
|
recs.innerHTML = html;
|
||||||
imageLoader.lazyChildren(recs);
|
imageLoader.lazyChildren(recs);
|
||||||
|
|
||||||
|
// FIXME: Wait for all sections to load
|
||||||
|
autoFocus(page);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function autoFocus(page) {
|
||||||
|
require(["autoFocuser"], function (autoFocuser) {
|
||||||
|
autoFocuser.autoFocus(page);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue