From 19894cb33f70280cb4888dc5a431e18173544e0f Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 10 Jun 2019 13:03:51 +0000 Subject: [PATCH] Bug 22744: Make checkboxes links Signed-off-by: Kyle M Hall --- .../prog/en/includes/messaging-preference-form.inc | 2 +- .../prog/js/messaging-preference-form.js | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc index 30d6e305d7..d1c835ba30 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc @@ -191,7 +191,7 @@ [% END %] --> [% UNLESS ( messaging_form_inactive ) %] - + Clear [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js b/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js index 8cb20df7f2..c55ab5db0d 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js +++ b/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js @@ -1,20 +1,12 @@ $(document).ready(function(){ - $(".none").click(function(){ - if($(this).prop("checked")){ + $(".clear_pref").click(function(){ var rowid = $(this).attr("id"); - var newid = Number(rowid.replace("none","")); + var newid = Number(rowid.replace("clear_","")); $("#sms"+newid).prop("checked", false); $("#email"+newid).prop("checked", false); $("#phone"+newid).prop("checked", false); $("#digest"+newid).prop("checked", false); $("#rss"+newid).prop("checked", false); - } - }); - $(".active_notify").on("change",function(){ - var attr_id = $(this).data("attr-id"); - if( $(this).prop("checked") ){ - $("#none" + attr_id ).prop("checked", false); - } }); $("#info_digests").tooltip(); @@ -36,7 +28,6 @@ $(document).ready(function(){ return; } } - $(".none").prop("checked", false); // When loading default prefs the "Clear" boxes should be cleared var jqxhr = $.getJSON('/cgi-bin/koha/members/default_messageprefs.pl?categorycode=' + categorycode, function(data) { $.each(data.messaging_preferences, function(i, item) { var attrid = item.message_attribute_id; -- 2.20.1 (Apple Git-117)