scope.closeBox = function () {
element.remove();
scope.$destroy();
- }
+ };
}
- }
+ };
}]);
ngApp.directive('commentEdit', [function () {
restrict: 'E',
templateUrl: 'comment-reply.html',
scope: {
- comment: '=',
+ comment: '='
},
link: function (scope, element) {
scope.isEdit = true;
scope.closeBox = function () {
element.remove();
scope.$destroy();
- }
+ };
}
- }
+ };
}]);
scope.$destroy();
});
- element.on('click', function () {
- var $container = element.parents('.comment-box').first();
+ element.on('click', function (e) {
+ e.preventDefault();
+ var $container = element.parents('.comment-actions').first();
if (!$container.length) {
console.error('commentReplyLink directive should be placed inside a container with class comment-box!');
return;
},
link: function (scope, element, attr, ctrl) {
- element.on('click', function() {
- var resp = $window.confirm('This will remove the content of the comment, are you sure you want to continue?');
- if (!resp) {
- return;
- }
+ element.on('click', function(e) {
+ e.preventDefault();
+ var resp = $window.confirm(trans('entities.comment_delete_confirm'));
+ if (!resp) {
+ return;
+ }
- ctrl.delete(scope.comment);
+ ctrl.delete(scope.comment);
});
}
};