Bugzilla – Attachment 6762 Details for
Bug 7350
In New order the "+" button duplicates input text but not the "selected" in ddl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Signed off patch
0001-Bug-7350-In-neworderempty.pl-duplicating-an-item-doe.patch (text/plain), 1.91 KB, created by
Duncan
on 2011-12-13 21:33:32 UTC
(
hide
)
Description:
Signed off patch
Filename:
MIME Type:
Creator:
Duncan
Created:
2011-12-13 21:33:32 UTC
Size:
1.91 KB
patch
obsolete
>From 18eef1bda12c35c93577cbafe57b1306f23eed10 Mon Sep 17 00:00:00 2001 >From: Christophe Croullebois <christophe.croullebois@biblibre.com> >Date: Sat, 10 Dec 2011 18:39:37 +0100 >Subject: [PATCH] Bug 7350: In neworderempty.pl duplicating an item does not > preserve select box selections > >cloneNode() does not preserve select box selections, I have created a function to duplicate them : "clone_with_selected". >It is included in "cloneItemBlock", that's all. >Now the values selected in ddl are duplicated as the imput-texts are. >--- > koha-tmpl/intranet-tmpl/prog/en/js/additem.js | 15 ++++++++++++++- > 1 files changed, 14 insertions(+), 1 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/additem.js b/koha-tmpl/intranet-tmpl/prog/en/js/additem.js >index efcb8eb..2f6c3fe 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/additem.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/additem.js >@@ -6,7 +6,7 @@ function deleteItemBlock(index) { > } > function cloneItemBlock(index) { > var original = document.getElementById(index); //original <div> >- var clone = original.cloneNode(true); >+ var clone = clone_with_selected(original) > var random = Math.floor(Math.random()*100000); // get a random itemid. > // set the attribute for the new 'div' subfields > clone.setAttribute('id',index + random);//set another id. >@@ -55,6 +55,19 @@ function check_additem() { > // duplicates within the form. > return success; > } >+ >+function clone_with_selected (node) { >+ var origin = node.getElementsByTagName("select"); >+ var tmp = node.cloneNode(true) >+ var selectelem = tmp.getElementsByTagName("select"); >+ for (var i=0; i<origin.length; i++) { >+ selectelem[i].selectedIndex = origin[i].selectedIndex; >+ } >+ origin = null; >+ selectelem = null; >+ return tmp; >+ } >+ > $(document).ready(function(){ > $(".cloneItemBlock").click(function(){ > var clonedRow = $(this).parent().parent().clone(true); >-- >1.7.5.4 >
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 7350
:
6743
| 6762 |
7160
|
7161
|
7162
|
7375
|
7376