Bugzilla – Attachment 147482 Details for
Bug 32728
ERM - Search header should change to match the section you are in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32728: Fix warning
Bug-32728-Fix-warning.patch (text/plain), 1.93 KB, created by
Jonathan Druart
on 2023-02-28 10:07:13 UTC
(
hide
)
Description:
Bug 32728: Fix warning
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-02-28 10:07:13 UTC
Size:
1.93 KB
patch
obsolete
>From a22f9f68a90b6cc591b321d5a2f5de7bf538cb6b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 28 Feb 2023 10:59:53 +0100 >Subject: [PATCH] Bug 32728: Fix warning > >There is a couple of wrong things from the previous patch: > >* There is a warning in the console >Firefox >[Vue Router warn]: Unexpected error when starting the router: TypeError: document.getElementById(...) is null >Chrome >[Vue Router warn]: Unexpected error when starting the router: TypeError: Cannot read properties of null (reading 'click') >That's because the tabs are not initialized yet, and so the tab is not >correctly selected when the app is loaded. > >* "Search titles" is selected when on packages, and "Search packages" is >selected when on titles > >This patch remove the warning and fix the second problem. > >However the tab is still wrong when the app is loaded. Will see later if >that can be fixed, but it's not trivial at first glance. >--- > koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts >index c03753f1303..e4290931dfd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts >@@ -63,10 +63,13 @@ router.beforeEach((to, from) => { > }); > router.afterEach((to, from) => { > let tab_id = 1; // Agreements >- if ( to.path.match(/\/erm\/eholdings\/local\/titles/)){ >+ if (to.path.match(/\/erm\/eholdings\/local\/packages/)) { > tab_id = 2; >- } else if ( to.path.match(/\/erm\/eholdings\/local\/packages/)){ >+ } else if (to.path.match(/\/erm\/eholdings\/local\/titles/)) { > tab_id = 3; > } >- document.getElementById('ui-id-' + tab_id).click(); >-}) >+ let node = document.getElementById("ui-id-" + tab_id); >+ if (node) { >+ node.click(); >+ } >+}); >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32728
:
145897
|
146264
|
147334
| 147482