From 9647654f39cc4ee12b49a59caafa9d495777ade0 Mon Sep 17 00:00:00 2001 From: Binary Alley Date: Fri, 6 Nov 2026 12:21:57 +0200 Subject: [PATCH] Fixes post-save navigation on the library form. --- .../Core/Views/Library/Management/Item.cshtml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Lumina.Presentation.Web/Core/Views/Library/Management/Item.cshtml b/src/Lumina.Presentation.Web/Core/Views/Library/Management/Item.cshtml index be95c6ac..617cb2de 100644 --- a/src/Lumina.Presentation.Web/Core/Views/Library/Management/Item.cshtml +++ b/src/Lumina.Presentation.Web/Core/Views/Library/Management/Item.cshtml @@ -493,14 +493,15 @@ await handleAddMediaLibraryAsync(); }; - // On back to libraries button click. - const handleBtnBackToLibrariesClick = function() { - window.location.href = '@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.INDEX)'; + // On back to libraries button click, navigates in place through the shared AJAX navigator instead of reloading the whole page. + const handleBtnBackToLibrariesClick = async function() { + await updateContentAsync('@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.INDEX)', true); }; - // On add new library button click. - const handleBtnAddNewLibraryClick = function() { - window.location.href = '@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.EDIT_LIBRARY)'; + // On add new library button click, navigates to the add library page through the shared AJAX navigator. The route of the add page is + // used, not the edit route template, which still contains the Id placeholder of the library being edited. + const handleBtnAddNewLibraryClick = async function() { + await updateContentAsync('@_urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.ADD_LIBRARY)', true); }; // On add media directory image click.