From 66e16bd236683c71d2d535939d6d963cbb9decd6 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 20 Apr 2016 10:29:03 -0400 Subject: [PATCH] Bug 16310 - Remove the use of "onclick" from audio alerts template Content-Type: text/plain; charset="utf-8" This patch removes one use of "onclick" in favor of defining events in the JavaScript. This patch also makes changes to the style of some buttons to make the interface a little more consistent with current practices. To test, apply the patch and go to Administration -> Audio alerts. - In the list of existing audio alerts, click the "Edit" button for any alert. The correct data should be loaded in the edit form. --- koha-tmpl/intranet-tmpl/prog/en/js/audio_alerts.js | 10 ++++++++++ koha-tmpl/intranet-tmpl/prog/en/modules/admin/audio_alerts.tt | 5 +++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/audio_alerts.js b/koha-tmpl/intranet-tmpl/prog/en/js/audio_alerts.js index 154c33a..6cc6d53 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/audio_alerts.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/audio_alerts.js @@ -65,6 +65,16 @@ $( document ).ready(function() { return false; } }); + + $(".edit").on("click",function(e){ + e.preventDefault(); + var elt = this; + var id = $(this).data("soundid"); + var precedence = $(this).data("precedence"); + var selector = $(this).data("selector"); + var sound = $(this).data("sound"); + EditAlert( elt, id, precedence, selector, sound ); + }); }); function enablePlayButton(sound_field_value,playbutton){ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/audio_alerts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/audio_alerts.tt index 83c9eca..2366251 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/audio_alerts.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/audio_alerts.tt @@ -111,14 +111,15 @@ [% a.selector %] [% a.sound %] - Edit + + Edit [% END %]

- +

-- 2.1.4