Bugzilla – Attachment 108395 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: Do not open options on clear
Bug-25727-Do-not-open-options-on-clear.patch (text/plain), 7.30 KB, created by
Jonathan Druart
on 2020-08-17 13:14:33 UTC
(
hide
)
Description:
Bug 25727: Do not open options on clear
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-08-17 13:14:33 UTC
Size:
7.30 KB
patch
obsolete
>From 4adba01af5e6717361c066d0347e5f83aef6f832 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 17 Aug 2020 12:58:10 +0000 >Subject: [PATCH] Bug 25727: Do not open options on clear > >We want to restore the previous behaviour and keep the options closed when >clear is clicked > >https://github.com/select2/select2/issues/3320#issuecomment-621662039 >--- > koha-tmpl/intranet-tmpl/prog/en/includes/select2.inc | 12 ++++++++++++ > .../intranet-tmpl/prog/en/modules/authorities/authorities.tt | 7 +------ > .../intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt | 7 +------ > .../intranet-tmpl/prog/en/modules/cataloguing/additem.tt | 4 ++-- > .../intranet-tmpl/prog/en/modules/serials/serials-edit.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js | 1 - > 6 files changed, 17 insertions(+), 16 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/select2.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/select2.inc >index dd1df60214..2d95ec466f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/select2.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/select2.inc >@@ -31,5 +31,17 @@ > removeAllItems:function(){return _("Remove all items")}, > removeItem:function(){return _("Remove item")} > }); >+ >+ $(document).ready(function(){ >+ $(".select2").select2(); >+ $(".select2").on("select2:clear", function (evt) { >+ $(this).on("select2:opening.cancelOpen", function (evt) { >+ evt.preventDefault(); >+ >+ $(this).off("select2:opening.cancelOpen"); >+ }); >+ }); >+ }); >+ > </script> > <!-- / select2.inc --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >index 3fcb56cb77..961b4b25e6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >@@ -168,11 +168,6 @@ function confirmnotdup(redirect){ > [% Asset.css("css/addbiblio.css") | $raw %] > > [% INCLUDE 'select2.inc' %] >-<script> >- $(document).ready(function() { >- $('.subfield_line select').select2(); >- }); >-</script> > > </head> > <body id="auth_authorities" class="auth"> >@@ -375,7 +370,7 @@ function confirmnotdup(redirect){ > > [% SET mv = subfield_loo.marc_value %] > [% IF ( mv.type == 'select' ) %] >- <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id | html -%]"> >+ <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor select2" id="[%- mv.id | html -%]"> > [% FOREACH aval IN mv.values %] > [% IF aval == mv.default %] > <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option> >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 77f851e9a5..ba0a120302 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >@@ -483,11 +483,6 @@ > [% Asset.css("css/addbiblio.css") | $raw %] > > [% INCLUDE 'select2.inc' %] >-<script> >- $(document).ready(function() { >- $('.subfield_line select').select2(); >- }); >-</script> > > </head> > <body id="cat_addbiblio" class="cat"> >@@ -852,7 +847,7 @@ > [% ELSIF ( mv.type == 'textarea' ) %] > <textarea cols="70" rows="4" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" class="input_marceditor" tabindex="1">[%- mv.value | html -%]</textarea> > [% ELSIF ( mv.type == 'select' ) %] >- <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id | html -%]"> >+ <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor select2" id="[%- mv.id | html -%]"> > [% FOREACH aval IN mv.values %] > [% IF aval == mv.default %] > <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >index 051695788c..28421edf85 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -158,9 +158,9 @@ > <input type="hidden" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]"> > [% ELSIF ( mv.type == 'select' ) %] > [% IF ( mv.readonly || ite.IS_RETURN_CLAIM ) %] >- <select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor" readonly="readonly" disabled="disabled"> >+ <select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor select2" readonly="readonly" disabled="disabled"> > [% ELSE %] >- <select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor"> >+ <select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor select2"> > [% END %] > [% FOREACH aval IN mv.values %] > [% IF aval == mv.default %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >index 8fe16b99fb..bcad4da652 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >@@ -234,7 +234,7 @@ $(document).ready(function() { > <label>[% iteminformatio.subfield | html %] - [% iteminformatio.marc_lib | $raw %]</label> > [% END %] > [% IF ( iteminformatio.marc_value.type == 'select' ) %] >- <select name="field_value" size="1"> >+ <select name="field_value" size="1" class="select2"> > [% FOREACH value IN iteminformatio.marc_value.values %] > [% IF ( value == iteminformatio.marc_value.default ) %] > <option value="[% value | html %]" selected="selected">[% iteminformatio.marc_value.labels.$value | html %]</option> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js >index e3e746764a..f2030b5d5e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js >@@ -72,7 +72,6 @@ $(document).ready(function(){ > multiCopyControl.toggle(); > }); > >- $('.subfield_line select').select2(); > }); > > function Check(f) { >-- >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