Bugzilla – Attachment 63137 Details for
Bug 18542
Move and style "new field" link in item search form
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18542 - Move and style "new field" link in item search form
Bug-18542---Move-and-style-new-field-link-in-item-.patch (text/plain), 2.63 KB, created by
Marc Véron
on 2017-05-04 16:42:41 UTC
(
hide
)
Description:
Bug 18542 - Move and style "new field" link in item search form
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2017-05-04 16:42:41 UTC
Size:
2.63 KB
patch
obsolete
>From 3c08d4c27737c052800b77633e715f037968b914 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Sat, 29 Apr 2017 19:36:18 +0000 >Subject: [PATCH] Bug 18542 - Move and style "new field" link in item search > form >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch modifies the item search page JavaScript so that the "New >field" link has a "+" icon and is always placed at the end of the last >row in that section of the form. > >To test, apply the patch and open the item search form in the staff >client. In the third section there should be a "+ New field" link at the >end of the first row of fields. > >Clicking the "New field" link should clone that row and move the link to >the end of the cloned row. > >Behaves as expected. >Signed-off-by: Marc Véron <veron@veron.ch> >--- > .../intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >index 5905e3e..b05056a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >@@ -193,7 +193,7 @@ > } > } > >- function addNewField() { >+ function addNewField( link ) { > var form_field = $('div.form-field-select-text').last(); > var copy = form_field.clone(true); > copy.find('input,select').not('[type="hidden"]').each(function() { >@@ -201,6 +201,7 @@ > }); > copy.find('.form-field-conjunction').prop('disabled', false); > form_field.after(copy); >+ link.remove(); > copy.find('select.form-field-column').change(); > } > >@@ -358,12 +359,12 @@ > // Add the "New field" link. > var form_field = $('div.form-field-select-text').last() > var NEW_FIELD = _("New field"); >- var button_field_new = $('<a href="#" class="button-field-new" title="Add a new field">' + NEW_FIELD + '</a>'); >- button_field_new.click(function() { >- addNewField(); >- return false; >- }); >- form_field.after(button_field_new); >+ var button_field_new = $('<a href="#" class="button-field-new" title="Add a new field"><i class="fa fa-plus"></i> ' + NEW_FIELD + '</a>'); >+ button_field_new.click(function(e) { >+ e.preventDefault(); >+ addNewField( $(this) ); >+ }); >+ form_field.append(button_field_new); > > // If a field is linked to an authorised values list, display the list. > $('div.form-field-select-text select').change(function() { >-- >2.1.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 18542
:
63135
|
63137
|
65030