#47 - Adds a cancel button for edit and reply button.

This commit is contained in:
Abijeet
2017-06-04 20:43:56 +05:30
parent 06d75e1804
commit 689d1eb082
3 changed files with 16 additions and 5 deletions

View File

@ -839,9 +839,13 @@ module.exports = function (ngApp, events) {
// no need for the event to do anything more.
event.stopPropagation();
event.preventDefault();
scope.closeBox();
});
scope.closeBox = function () {
element.remove();
scope.$destroy();
});
}
}
}
}]);
@ -861,10 +865,14 @@ module.exports = function (ngApp, events) {
event.stopPropagation();
event.preventDefault();
if (commentId === scope.comment.id && !scope.isNew) {
element.remove();
scope.$destroy();
scope.closeBox();
}
});
scope.closeBox = function () {
element.remove();
scope.$destroy();
}
}
}
}]);