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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt (-20 / +10 lines)
Lines 250-285 Link Here
250
        $(document).ready(function(){
250
        $(document).ready(function(){
251
            $("#info_digests").tooltip();
251
            $("#info_digests").tooltip();
252
252
253
            // At load time, we want digest disabled if no digest using transport is enabled
253
            function toggle_digest(id){
254
            $(".pmp_email").each(function(){
255
                var rowid = $(this).attr("id");
256
                id = Number(rowid.replace("email",""));
257
                if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") ) {
254
                if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") ) {
258
                    $("#digest"+id).attr("disabled", false).tooltip('disable');
255
                    $("#digest"+id).attr("disabled", false).tooltip('disable');
259
                } else {
256
                } else {
260
                    $("#digest"+id).attr("disabled", true).tooltip('enable');
257
                    $("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
261
                }
258
                }
259
260
            }
261
            // At load time, we want digest disabled if no digest using transport is enabled
262
            $(".pmp_email").each(function(){
263
                toggle_digest(Number($(this).attr("id").replace("email", "")));
262
            });
264
            });
263
265
264
            // If user clears all digest using transports for a notice, disable digest checkbox
266
            // If user clears all digest using transports for a notice, disable digest checkbox
265
            $(".pmp_email").click(function(){
267
            $(".pmp_email").click(function(){
266
                var rowid = $(this).attr("id");
268
                toggle_digest(Number($(this).attr("id").replace("email", "")));
267
                id = Number(rowid.replace("email",""));
268
                if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") ) {
269
                    $("#digest"+id).attr("disabled", false).tooltip('disable');
270
                } else {
271
                    $("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
272
                }
273
            });
269
            });
274
            $(".pmp_sms").click(function(){
270
            $(".pmp_sms").click(function(){
275
                var rowid = $(this).attr("id");
271
                toggle_digest(Number($(this).attr("id").replace("sms", "")));
276
                id = Number(rowid.replace("sms",""));
277
                if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") ) {
278
                    $("#digest"+id).attr("disabled", false).tooltip('disable');
279
                } else {
280
                    $("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
281
                }
282
            });
272
            });
273
283
        });
274
        });
284
275
285
        function normalizeSMS(value){
276
        function normalizeSMS(value){
286
- 

Return to bug 13613