Bugzilla – Attachment 114400 Details for
Bug 27124
JS error "select2Width is not defined"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27124: JS error "select2Width is not defined"
Bug-27124-JS-error-select2Width-is-not-defined.patch (text/plain), 2.66 KB, created by
Lucas Gass (lukeg)
on 2020-12-14 23:24:10 UTC
(
hide
)
Description:
Bug 27124: JS error "select2Width is not defined"
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2020-12-14 23:24:10 UTC
Size:
2.66 KB
patch
obsolete
>From b9dfa3510a4885b7579e2ac027a8e37090be6df5 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 10 Dec 2020 11:48:43 +0000 >Subject: [PATCH] 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> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt | 4 ++-- > koha-tmpl/intranet-tmpl/prog/js/select2.js | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >index 38b3ab8ca8..32aeac779d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >@@ -5,11 +5,11 @@ > <title>Koha › Cataloging › [% IF ( biblionumber ) %]Editing [% title | html %] (Record number [% biblionumber | html %])[% ELSE %]Add MARC record[% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] > [% Asset.js("lib/hc-sticky.js") | $raw %] >+[% INCLUDE 'select2.inc' %] > <script> > var CAN_user_parameters_manage_auth_values = "[% CAN_user_parameters_manage_auth_values | html %]"; >- var select2Width = "100%"; >+ $.fn.select2.defaults.set("width", "100%" ); > </script> >-[% INCLUDE 'select2.inc' %] > [% Asset.js("js/cataloging.js") | $raw %] > [% Asset.js("js/browser.js") | $raw %] > <script> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/select2.js b/koha-tmpl/intranet-tmpl/prog/js/select2.js >index a5c07fe12a..0b68c3fd28 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/select2.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/select2.js >@@ -1,7 +1,7 @@ > /* global __ */ > $.fn.select2.defaults.set("allowClear", true); > $.fn.select2.defaults.set("placeholder", ""); >-$.fn.select2.defaults.set("width", select2Width || "element" ); >+$.fn.select2.defaults.set("width", "element" ); > > // Internationalization > $.fn.select2.defaults.set("language", { >-- >2.11.0
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 27124
:
114152
|
114163
|
114236
|
114300
|
114400
|
114441