From 4a74ed65b371ff8feb940cbe1d217dc70503d52e 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Signed-off-by: Marc VĂ©ron --- koha-tmpl/intranet-tmpl/prog/en/js/audio_alerts.js | 10 ++++++++++ .../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 %]

- +

-- 1.7.10.4