From 3128ee6953e3bde9f9851f7bf7e24aaa25db3b53 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 22 Nov 2016 11:28:51 +0000 Subject: [PATCH] Bug 17344 - Followup to fix selectors Add '#' selector to several tags Fix some spacing Remove duplicated line To highlight that all is working set PatronQuickAddFields as below for testing: streetnumber|address|address2|city|state|zipcode|country|branchcode Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- koha-tmpl/intranet-tmpl/prog/js/members.js | 31 +++++++++++----------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js index 5089d29697..3ea7868fcd 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/members.js +++ b/koha-tmpl/intranet-tmpl/prog/js/members.js @@ -186,13 +186,13 @@ function update_category_code(category_code) { function select_user(borrowernumber, borrower) { var form = $('#entryform').get(0); if (form.guarantorid.value) { - $("#contact-details,#quick_add_form #contact-details").find('a').remove(); - $("#contactname, #contactfirstname,#quick_add_form #contact-details").parent().find('span').remove(); + $("#contact-details, #quick_add_form #contact-details").find('a').remove(); + $("#contactname, #contactfirstname, #quick_add_form #contactname, #quick_add_form #contactfirstname").parent().find('span').remove(); } var id = borrower.borrowernumber; form.guarantorid.value = id; - $('#contact-details,#quick_add_form #contact-details') + $('#contact-details, #quick_add_form #contact-details') .show() .find('span') .after('' + id + ''); @@ -215,14 +215,14 @@ function select_user(borrowernumber, borrower) { form.country.value = borrower.country; form.branchcode.value = borrower.branchcode; - $("quick_add_form #streetnumber").val(borrower.streetnumber); - $("quick_add_form #address").val(borrower.address); - $("quick_add_form #address2").val(borrower.address2); - $("quick_add_form #city").val(borrower.city); - $("quick_add_form #state").val(borrower.state); - $("quick_add_form #zipcode").val(borrower.zipcode); - $("quick_add_form #country").val(borrower.country); - $("quick_add_form #branchcode").val(borrower.branchcode); + $("#quick_add_form #streetnumber").val(borrower.streetnumber); + $("#quick_add_form #address").val(borrower.address); + $("#quick_add_form #address2").val(borrower.address2); + $("#quick_add_form #city").val(borrower.city); + $("#quick_add_form #state").val(borrower.state); + $("#quick_add_form #zipcode").val(borrower.zipcode); + $("#quick_add_form #country").val(borrower.country); + $("#quick_add_form select[name='branchcode']").val(borrower.branchcode); form.guarantorsearch.value = LABEL_CHANGE; $("#quick_add_form #guarantorsearch").val(LABEL_CHANGE); @@ -299,13 +299,12 @@ $(document).ready(function(){ $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit"); $("#guarantordelete").click(function() { - $("#quick_add_form #contact-details,#contact-details").hide().find('a').remove(); - $("#quick_add_form #guarantorid,#quick_add_form #contactname,#quick_add_form #contactfirstname, #guarantorid,#contactname,#contactfirstname").each(function () { this.value = ""; }); - $("#quick_add_form #contactname, #quick_add_form #contactfirstname,#contactname,#contactfirstname") + $("#quick_add_form #contact-details, #contact-details").hide().find('a').remove(); + $("#quick_add_form #guarantorid, #quick_add_form #contactname, #quick_add_form #contactfirstname, #guarantorid, #contactname, #contactfirstname").each(function () { this.value = ""; }); + $("#quick_add_form #contactname, #quick_add_form #contactfirstname, #contactname, #contactfirstname") .each(function () { this.type = 'text'; }) .parent().find('span').remove(); - $("#quick_add_form #guarantorsearch,#guarantorsearch").val(LABEL_SET_TO_PATRON); - $("quick_add_form #guarantorsearch,#guarantorsearch").val(LABEL_SET_TO_PATRON); + $("#quick_add_form #guarantorsearch, #guarantorsearch").val(LABEL_SET_TO_PATRON); }); $("#select_city").change(function(){ -- 2.39.5