Bugzilla – Attachment 59770 Details for
Bug 17988
Select2 prevents correct tag expand/minimize functionality
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17988 - Select2 prevents correct tag expand/minimize functionality
Bug-17988---Select2-prevents-correct-tag-expandmin.patch (text/plain), 2.10 KB, created by
Jonathan Druart
on 2017-02-02 09:29:11 UTC
(
hide
)
Description:
Bug 17988 - Select2 prevents correct tag expand/minimize functionality
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-02-02 09:29:11 UTC
Size:
2.10 KB
patch
obsolete
>From 8862564e5745c0a15548c4409031a810aa9ed06b Mon Sep 17 00:00:00 2001 >From: Oleg Vasylenko <synapse.ova@gmail.com> >Date: Wed, 25 Jan 2017 12:01:05 +0200 >Subject: [PATCH] Bug 17988 - Select2 prevents correct tag expand/minimize > functionality >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Overview: >Select2 (Bug 13501) introduced divs and inputs that broke some assumptions about the expected HTML structure. >Because of that, expanding fields to show all hidden subfields does not work properly. > >Steps to Reproduce: >1. Open some book in the editor or create new (cataloguing/addbiblio.pl) >2. Try to minimize or expand fields, that have among subfields the following: > â Thesaurus driven subfield â subfield with Select2 > â Hidden subfield. > >Actual Results: > â some fields become hidden, some not, and vice versa > â in the console, you'll see «Uncaught TypeError: Cannot read property 'match' of null» > >Expected Results: > â all subfields should minimize/maximize completely > >Additional Information: >This happens because Select2 adds some divs, that do not have ID property. >The following patch adds check for the needed attribute existance. > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > koha-tmpl/intranet-tmpl/prog/js/cataloging.js | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >index 59efd6c..f4abf2f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >@@ -59,6 +59,7 @@ function ExpandField(index) { > var original = document.getElementById(index); //original <div> > var divs = original.getElementsByTagName('div'); > for(var i=0,divslen = divs.length ; i<divslen ; i++){ // foreach div >+ if(divs[i].hasAttribute('id') == 0 ) {continue; } > if(divs[i].getAttribute('id').match(/^subfield/)){ // if it s a subfield > if (!divs[i].style.display) { > // first time => show all subfields >-- >2.9.3
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 17988
:
59543
|
59758
| 59770 |
59771