Bug 32728: Fix warning
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 28 Feb 2023 09:59:53 +0000 (10:59 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 2 Mar 2023 12:37:37 +0000 (09:37 -0300)
commit87e717406bdbd48340115fe7522a7184359116bb
treef0600fa82e83f0c3cd0250e19e36d653399ca98e
parenta3087d76bd31f59ac437e63d7031b2202cb64e5c
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.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts