fix(messages): fixed messages box delete button show/hide issue

This commit is contained in:
OldHawk
2017-12-25 15:28:28 +08:00
parent b0b9c49985
commit 2f9ea2f5ed
2 changed files with 9 additions and 1 deletions

View File

@@ -219,6 +219,9 @@
vm.messages.splice(vm.messages.indexOf(m), 1);
});
vm.figureOutItemsToDisplay();
vm.selectedAll = false;
$rootScope.$broadcast('user-unread-count-changed');
NotifycationService.showSuccessNotify('MESSAGE_DELETED_SUCCESSFULLY');
}, function (res) {
@@ -521,6 +524,8 @@
vm.figureOutItemsToDisplay();
vm.hideMessage();
$rootScope.$broadcast('user-unread-count-changed');
NotifycationService.showSuccessNotify('MESSAGE_DELETED_SUCCESSFULLY');
}, function (res) {
NotifycationService.showErrorNotify(res.data.message, 'MESSAGE_DELETED_ERROR');

View File

@@ -121,7 +121,10 @@
next-text="{{ 'PAGE_TEXT_NEXT' | translate}}" last-text="{{ 'PAGE_TEXT_LAST' | translate}}">
</ul>
<div class="pull-right margin-top-20">
<button class="btn btn-success btn-width-100" ng-click="vm.deleteSelected()">{{ 'BUTTON_MESSAGE_DELETE' | translate }}</button>
<button class="btn btn-success btn-width-100"
ng-if="vm.messageType=='user' || vm.messageType=='server'"
ng-click="vm.deleteSelected()">{{ 'BUTTON_MESSAGE_DELETE' | translate }}
</button>
</div>
</div>
</div>