##// END OF EJS Templates
comments: use better sweet alert confirm dialog.
marcink -
r4312:4d4359b7 default
parent child Browse files
Show More
@@ -555,10 +555,7 b' var CommentsController = function() {'
555 555 return self.scrollToComment(node, -1, true);
556 556 };
557 557
558 this.deleteComment = function(node) {
559 if (!confirm(_gettext('Delete this comment?'))) {
560 return false;
561 }
558 this._deleteComment = function(node) {
562 559 var $node = $(node);
563 560 var $td = $node.closest('td');
564 561 var $comment = $node.closest('.comment');
@@ -585,6 +582,24 b' var CommentsController = function() {'
585 582 return false;
586 583 };
587 584 ajaxPOST(url, postData, success, failure);
585 }
586
587 this.deleteComment = function(node) {
588 var $comment = $(node).closest('.comment');
589 var comment_id = $comment.attr('data-comment-id');
590
591 Swal.fire({
592 title: 'Delete this comment?',
593 icon: 'warning',
594 showCancelButton: true,
595 confirmButtonColor: '#84a5d2',
596 cancelButtonColor: '#e85e4d',
597 confirmButtonText: _gettext('Yes, delete comment #{0}!').format(comment_id)
598 }).then(function(result) {
599 if (result.value) {
600 self._deleteComment(node);
601 }
602 })
588 603 };
589 604
590 605 this.toggleWideMode = function (node) {
General Comments 0
You need to be logged in to leave comments. Login now