Bugzilla – Attachment 114152 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), 1.59 KB, created by
Owen Leonard
on 2020-12-03 16:16:51 UTC
(
hide
)
Description:
Bug 27124: JS error "select2Width is not defined"
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-12-03 16:16:51 UTC
Size:
1.59 KB
patch
obsolete
>From 6f69a03f3f0d83059363c6d66308383d434f77c3 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 3 Dec 2020 16:12:46 +0000 >Subject: [PATCH] Bug 27124: JS error "select2Width is not defined" > >This patch changes the way select2.js checks for an existing value of >the "select2Width" variable in order to avoid errors when it is >undefined. > >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. >--- > koha-tmpl/intranet-tmpl/prog/js/select2.js | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/select2.js b/koha-tmpl/intranet-tmpl/prog/js/select2.js >index a5c07fe12a..f591cab9d9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/select2.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/select2.js >@@ -1,7 +1,8 @@ > /* global __ */ >+var select2Width = typeof select2Width === "undefined" || !select2Width ? "element" : select2Width; > $.fn.select2.defaults.set("allowClear", true); > $.fn.select2.defaults.set("placeholder", ""); >-$.fn.select2.defaults.set("width", select2Width || "element" ); >+$.fn.select2.defaults.set("width", select2Width ); > > // 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