Bugzilla – Attachment 105977 Details for
Bug 25727
Update the Select2 JS lib
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25727: Fix default values
Bug-25727-Fix-default-values.patch (text/plain), 2.38 KB, created by
Owen Leonard
on 2020-06-17 16:27:08 UTC
(
hide
)
Description:
Bug 25727: Fix default values
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-06-17 16:27:08 UTC
Size:
2.38 KB
patch
obsolete
>From 91366f5f4414bf24b0668ef34fbba0a06bb59b65 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sat, 13 Jun 2020 14:08:11 +0200 >Subject: [PATCH] Bug 25727: Fix default values > >The way we defined the default values does not longer work (?) >Using > $.fn.select2.defaults.set >instead of > jQuery.extend($.fn.select2.defaults, { >fixes the problem. > >It restores the allowClear setting. > >There is a change in the behavior here, the selection opens when the >clear button is clicked. That is coming from a change in Select2 >apparently. We may want to hack something to restore the precedent >behaviour. > >This patch also removes the redefinition of the width. It seems that the >issue that this code was trying to correct is now fixed. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../intranet-tmpl/prog/en/includes/select2.inc | 27 ++++------------------ > 1 file changed, 5 insertions(+), 22 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/select2.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/select2.inc >index 9652f0b573..d5a95bf5ec 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/select2.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/select2.inc >@@ -5,27 +5,11 @@ > [% Asset.css("css/select2.css") | $raw %] > <!-- select2.inc --> > <script> >- jQuery.extend($.fn.select2.defaults, { >- allowClear: true, >- width: function() { >- var width = this.element.outerWidth(); >+ $.fn.select2.defaults.set("allowClear", true); >+ $.fn.select2.defaults.set("placeholder", ""); > >- // 18 is the width of .select2-arrow >- width -= 18; >- >- if (this.allowClear) { >- // 42 is the margin-right of .select2-chosen when allowClear is true >- width += 42; >- } else { >- // 26 is the margin-right of .select2-chosen when allowClear is false >- width += 26; >- } >- >- return width; >- }, >- >- // Internationalization >- language: { >+ // Internationalization >+ $.fn.select2.defaults.set("language", { > errorLoading:function(){return"The results could not be loaded."}, > inputTooLong:function(e){ > var n = e.input.length - e.max; >@@ -43,7 +27,6 @@ > searching:function(){return _("Searchingâ¦")}, > removeAllItems:function(){return _("Remove all items")}, > removeItem:function(){return _("Remove item")} >- } >- }); >+ }); > </script> > <!-- / select2.inc --> >-- >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 25727
:
105822
|
105853
|
105854
|
105855
|
105975
|
105976
|
105977
|
105978
|
105979
|
105980
|
108351
|
108352
|
108353
|
108354
|
108355
|
108395
|
108400
|
108436
|
108823
|
108829
|
108830
|
108875
|
108876
|
108877
|
108878
|
108879
|
108880
|
108881
|
108882
|
109359
|
109361