#47 - Changes the way we are handling fetching of data for the comment section.

This commit is contained in:
Abijeet
2017-05-30 09:02:47 +05:30
parent 9a97995f18
commit 860d4d4be5
9 changed files with 119 additions and 74 deletions

View File

@ -825,10 +825,12 @@ module.exports = function (ngApp, events) {
templateUrl: 'comment-reply.html',
scope: {
pageId: '=',
parentId: '='
parentId: '=',
parent: '='
},
link: function (scope, element) {
scope.isReply = true;
element.find('textarea').focus();
scope.$on('evt.comment-success', function (event) {
// no need for the event to do anything more.
event.stopPropagation();
@ -849,6 +851,7 @@ module.exports = function (ngApp, events) {
},
link: function (scope, element) {
scope.isEdit = true;
element.find('textarea').focus();
scope.$on('evt.comment-success', function (event, commentId) {
// no need for the event to do anything more.
event.stopPropagation();
@ -892,7 +895,7 @@ module.exports = function (ngApp, events) {
function compileHtml($container, scope, isReply) {
let lnkFunc = null;
if (isReply) {
lnkFunc = $compile('<comment-reply page-id="comment.pageId" parent-id="comment.id"></comment-reply>');
lnkFunc = $compile('<comment-reply page-id="comment.pageId" parent-id="comment.id" parent="comment"></comment-reply>');
} else {
lnkFunc = $compile('<comment-edit comment="comment"></comment-add>');
}