From c6162c4c88da2a903f07dd114d23d75cc94e9478 Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Thu, 12 Mar 2015 22:57:00 +0100 Subject: Fix JavaScript problems on channels where you are not allowed to upload photos. Add some try...catch blocks around JavaScript that throws errors. This commit should fix the current problems that were introduced by an earlier commit. --- view/tpl/jot-header.tpl | 102 ++++++++++++++++++++++-------------------------- 1 file changed, 46 insertions(+), 56 deletions(-) (limited to 'view/tpl/jot-header.tpl') diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index c7bb7506e..0ffed7163 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -1,6 +1,6 @@ @@ -362,16 +353,15 @@ function enableOnUser(){ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-delete-link,.block-delete-link", function(e) { var link = $(this).attr("href"); // "get" the intended link in a var - if (typeof(eval($.fn.modal)) === 'function'){ - e.preventDefault(); - bootbox.confirm("

{{$confirmdelete}}

",function(result) { - if (result) { - document.location.href = link;} - });} - else { - return confirm("{{$confirmdelete}}"); - } - }); + if (typeof(eval($.fn.modal)) === 'function'){ + e.preventDefault(); + bootbox.confirm("

{{$confirmdelete}}

",function(result) { + if (result) { + document.location.href = link; + } + }); + } else { + return confirm("{{$confirmdelete}}"); + } +}); - - -- cgit v1.2.3