Bug 27124: JS error "select2Width is not defined"
authorOwen Leonard <oleonard@myacpl.org>
Thu, 10 Dec 2020 11:48:43 +0000 (11:48 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 21 Dec 2020 09:07:40 +0000 (10:07 +0100)
commitff7318c62ec7097c5b88f7278b71d0cc7feb1f39
tree624ac5de3d3c04a2e083e37f104f5b20f0b03ec4
parentde4d6983ab614f56d0514ff4060543da69b2b651
Bug 27124: JS error "select2Width is not defined"

This patch changes the default width paramter passed to the
select2 plugin. This allows the basic MARC editor's Select2
widgets to be styled differently than on other pages.

To test, apply the patch and view various pages where the select2 plugin
is used:

 - Basic MARC editor
 - Items edit
 - Batch item edit
 - Authority editor

In each case check that the Select2 plugin works correctly to style
fields like collection code and home library.

On the basic MARC editor page these <select>s should have a width
that adjusts as the browser window changes. On other pages the width
should be fixed.

Check the browser console and confirm that there are no JavaScript
errors.

Update: Thanks to Julian for the suggested optimization

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt
koha-tmpl/intranet-tmpl/prog/js/select2.js