Bug 16281: [Follow-up] Remove the use of "onclick" from Reports module
authorOwen Leonard <oleonard@myacpl.org>
Fri, 22 Apr 2016 13:31:10 +0000 (09:31 -0400)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 29 Apr 2016 10:58:29 +0000 (10:58 +0000)
This minor follow-up adds a dummy href attribute to the "Return to the
previous page" link so that the link behaves like a link. A
"preventDefault()" is added to the goback() function to keep the "#"
link from triggering a page jump.

To test, apply the patch, create a report with an SQL error and run
it. Confirm that the 'Return to previous page' link works as expected.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt

index a139f61..bbc539b 100644 (file)
@@ -68,7 +68,8 @@ function load_group_subgroups () {
 
 $(document).ready(function(){
 
-$(".goback").on("click",function(){
+$(".goback").on("click",function(e){
+    e.preventDefault();
     window.history.back();
 });
 
@@ -1017,7 +1018,7 @@ Sub report:<select name="subreport">
     [% ELSE %]
     [% END %]
     <div id="onerror_actions">
-        <a class="button goback">Return to previous page</a>
+        <a href="#" class="button goback">Return to previous page</a>
     </div>
 [% END %]
 </div>