Skip to content

Commit

Permalink
Merge pull request rapidpro#135 from praekelt/feature/OPENHELPD-112
Browse files Browse the repository at this point in the history
un-flag confirmation prompt added
  • Loading branch information
projectmushroom authored Sep 23, 2016
2 parents 837a31c + 990e5f4 commit 68f423e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions static/coffee/controllers.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,16 @@ controllers.controller('MessagesController', ['$scope', '$timeout', '$uibModal',
#----------------------------------------------------------------------------

$scope.onToggleMessageFlag = (message) ->
MessageService.bulkFlag([message], !message.flagged).then(() ->
$scope.updateItems()
)
if $scope.folder == 'flagged'
UtilsService.confirmModal('Are you sure you want to un-flag this message?').then(() ->
MessageService.bulkFlag([message], !message.flagged).then(() ->
$scope.updateItems()
)
)
else
MessageService.bulkFlag([message], !message.flagged).then(() ->
$scope.updateItems()
)

$scope.onReplyToMessage = (message) ->
$uibModal.open({templateUrl: '/partials/modal_reply.html', controller: 'ReplyModalController', resolve: {selection: (() -> null), maxLength: (() -> OUTGOING_TEXT_MAX_LEN)}})
Expand Down

0 comments on commit 68f423e

Please sign in to comment.