View | Details | Raw Unified | Return to bug 35012
Collapse All | Expand All

(-)a/Koha/FrameworkPlugin.pm (-2 / +12 lines)
Lines 329-335 sub _add_binding { Link Here
329
        #click event applies to buttonDot
329
        #click event applies to buttonDot
330
330
331
    if( $pars =~ /^(e|ev|event)$/i ) { # new style event handler assumed
331
    if( $pars =~ /^(e|ev|event)$/i ) { # new style event handler assumed
332
        $bind= qq|    \$("#$ctl").$ev(\{id: '$id'\}, $fname);\n|;
332
        
333
        if ($ev eq "click"){
334
          # remove already registered click listeners
335
          $bind= qq|    \$("#$ctl").off('click');\n|;
336
          $bind.= qq|    \$("#$ctl").$ev(\{id: '$id'\}, $fname);\n|;
337
        } else {
338
          $bind= qq|    \$("#$ctl").$ev(\{id: '$id'\}, $fname);\n|;
339
        }
340
        
333
        $script='';
341
        $script='';
334
    } elsif( $fname eq 'noclick' ) { # no click: return false, no scroll
342
    } elsif( $fname eq 'noclick' ) { # no click: return false, no scroll
335
        $bind= qq|    \$("#$ctl").$ev(function () { return false; });\n|;
343
        $bind= qq|    \$("#$ctl").$ev(function () { return false; });\n|;
Lines 379-387 sub _merge_script { Link Here
379
$script
387
$script
380
function BindEvents$id() {
388
function BindEvents$id() {
381
$bind
389
$bind
390
382
}
391
}
383
\$(document).ready(function() {
392
\$(document).ready(function() {
384
    BindEvents$id();
393
    BindEvents$id();
394
395
385
});
396
});
386
</script>
397
</script>
387
HERE
398
HERE
388
- 

Return to bug 35012