Summary: | IntranetUserJS is called twice on spinelable-print.tt | ||
---|---|---|---|
Product: | Koha | Reporter: | Lucas Gass (lukeg) <lucas> |
Component: | Label/patron card printing | Assignee: | Lucas Gass (lukeg) <lucas> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | trivial | ||
Priority: | P5 - low | CC: | fridolin.somers, kyle, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
21.11.00,21.05.05,20.11.11
|
|
Circulation function: | |||
Attachments: |
Bug 28940: In spinelabel-print.tt call IntranetUserJS only once
Bug 28940: In spinelabel-print.tt call IntranetUserJS only once Bug 28940: In spinelabel-print.tt call IntranetUserJS only once |
Description
Lucas Gass (lukeg)
2021-09-01 18:59:24 UTC
Created attachment 124415 [details] [review] Bug 28940: In spinelabel-print.tt call IntranetUserJS only once 1. In IntranetUser add some JS that will target spinelabel-print.tt, I used this: if ( $('#labels_spinelabel-print').length ) { $('#labels_spinelabel-print').append('<div>TEST</div>'); console.log('TEST'); } 2. Generate a quick spine label 3. Once you have entered a barcode the JS will go off 2x. With the jQuery added you will see 2 div's with the word 'TEST'. Look at the console and you will also see TEST console logged 2x. 4. Apply patch 5. Try seto 2 and 3 again, the JS should only be called once. Created attachment 124843 [details] [review] Bug 28940: In spinelabel-print.tt call IntranetUserJS only once 1. In IntranetUser add some JS that will target spinelabel-print.tt, I used this: if ( $('#labels_spinelabel-print').length ) { $('#labels_spinelabel-print').append('<div>TEST</div>'); console.log('TEST'); } 2. Generate a quick spine label 3. Once you have entered a barcode the JS will go off 2x. With the jQuery added you will see 2 div's with the word 'TEST'. Look at the console and you will also see TEST console logged 2x. 4. Apply patch 5. Try seto 2 and 3 again, the JS should only be called once. Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Created attachment 125320 [details] [review] Bug 28940: In spinelabel-print.tt call IntranetUserJS only once 1. In IntranetUser add some JS that will target spinelabel-print.tt, I used this: if ( $('#labels_spinelabel-print').length ) { $('#labels_spinelabel-print').append('<div>TEST</div>'); console.log('TEST'); } 2. Generate a quick spine label 3. Once you have entered a barcode the JS will go off 2x. With the jQuery added you will see 2 div's with the word 'TEST'. Look at the console and you will also see TEST console logged 2x. 4. Apply patch 5. Try seto 2 and 3 again, the JS should only be called once. Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Pushed to master for 21.11, thanks to everybody involved! Pushed to 21.05.x for 21.05.05 Pushed to 20.11.x for 20.11.11 Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed. |