This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See http://git.chorem.org/pollen.git commit 0b552d95f3d8904f28d6bb376ccd059e7023ca47 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Thu Jun 12 17:27:17 2014 +0200 improvement delete comment --- pollen-ui-angular/src/main/webapp/css/style.css | 4 ++++ pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js | 11 +++++++++++ pollen-ui-angular/src/main/webapp/partials/poll-comment.html | 3 ++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/pollen-ui-angular/src/main/webapp/css/style.css b/pollen-ui-angular/src/main/webapp/css/style.css index 6b8a543..11ae47b 100644 --- a/pollen-ui-angular/src/main/webapp/css/style.css +++ b/pollen-ui-angular/src/main/webapp/css/style.css @@ -210,6 +210,10 @@ i.icon-collapse { color: #a94442; } +.fakeLink { + cursor:pointer; +} + #comments { margin-top:30px; width:100%; diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js index b6c1273..0388b6d 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -803,8 +803,19 @@ angular.module('pollControllers', []) }).then( function () { var confirmDelete = confirm(confirmMessage); if (confirmDelete == true) { + // check if not on edit + if (comment.id == $scope.comment.id) { + //clean form + $scope.comment.text = ''; + delete $scope.comment.postDate; + delete $scope.comment.id; + delete $scope.comment.permission; + } + PollComment.remove({pollId:$routeParams.pollId, permission:$scope.globalVariables.permission, commentId:comment.id}, function (data) { + // reload comments initComments().then(function () { + // if no comment then change page if it's possible if ($scope.data.comments.length == 0 && paginationParameter.pageNumber > 0) { // no comment and not the first page $scope.data.commentsPagination.currentPage = paginationParameter.pageNumber - 1; diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-comment.html b/pollen-ui-angular/src/main/webapp/partials/poll-comment.html index cb1504a..381b03b 100644 --- a/pollen-ui-angular/src/main/webapp/partials/poll-comment.html +++ b/pollen-ui-angular/src/main/webapp/partials/poll-comment.html @@ -56,7 +56,8 @@ <td> <i class="glyphicon glyphicon-user"></i>{{comment.authorName}}<br/> <i class="glyphicon glyphicon-calendar"></i>{{comment.postDate | date:globalVariables.dateFormat}}<br/> - <i class="glyphicon glyphicon-pencil" ng-show="comment.id" ng-click="editPost(comment)"></i> <i class="glyphicon glyphicon-remove danger" ng-show="comment.id" ng-click="deletePost(comment)"></i> + <i class="glyphicon glyphicon-pencil fakeLink" ng-show="comment.id" ng-click="editPost(comment)"></i> + <i class="glyphicon glyphicon-remove danger fakeLink" ng-show="comment.id" ng-click="deletePost(comment)"></i> </td> <td> <div ng-bind-html="toHTML(comment.text)"></div> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm