Bugzilla – Attachment 67452 Details for
Bug 18422
Add Select2 to authority editor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18422: (QA follow-up) Check if select2 is available before using it
Bug-18422-QA-follow-up-Check-if-select2-is-availab.patch (text/plain), 1.59 KB, created by
Julian Maurice
on 2017-09-29 13:56:12 UTC
(
hide
)
Description:
Bug 18422: (QA follow-up) Check if select2 is available before using it
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2017-09-29 13:56:12 UTC
Size:
1.59 KB
patch
obsolete
>From 9d4972e7a48265910c7a5f714dcabbecd9fa41b4 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 29 Sep 2017 15:52:50 +0200 >Subject: [PATCH] Bug 18422: (QA follow-up) Check if select2 is available > before using it > >cataloging.js might not always be loaded with select2.js, so we should >check its availability to prevent JS errors > >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > koha-tmpl/intranet-tmpl/prog/js/cataloging.js | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >index eedac25377..65e7e26ef6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >@@ -77,16 +77,20 @@ function ExpandField(index) { > > var Select2Utils = { > removeSelect2: function(element) { >- var selects = element.getElementsByTagName('select'); >- for (var i=0; i < selects.length; i++) { >- $(selects[i]).select2('destroy'); >+ if ($.fn.select2) { >+ var selects = element.getElementsByTagName('select'); >+ for (var i=0; i < selects.length; i++) { >+ $(selects[i]).select2('destroy'); >+ } > } > }, > > initSelect2: function(element) { >- var selects = element.getElementsByTagName('select'); >- for (var i=0; i < selects.length; i++) { >- $(selects[i]).select2(); >+ if ($.fn.select2) { >+ var selects = element.getElementsByTagName('select'); >+ for (var i=0; i < selects.length; i++) { >+ $(selects[i]).select2(); >+ } > } > } > }; >-- >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 18422
:
62070
|
67142
|
67451
| 67452