Draft delete confirmation when editing it (#1081)

This commit is contained in:
RainLoop Team 2016-06-21 22:22:11 +03:00
parent a0a9acf9d9
commit b1f85ef41c

View file

@ -334,8 +334,21 @@
this.deleteCommand = Utils.createCommand(this, function () {
require('App/User').default.deleteMessagesFromFolderWithoutCheck(this.draftFolder(), [this.draftUid()]);
kn.hideScreenPopup(ComposePopupView);
var
self = this,
PopupsAskViewModel = require('View/Popup/Ask')
;
if (!kn.isPopupVisible(PopupsAskViewModel) && this.modalVisibility())
{
kn.showScreenPopup(PopupsAskViewModel, [Translator.i18n('POPUPS_ASK/DESC_WANT_DELETE_MESSAGES'), function () {
if (self.modalVisibility())
{
require('App/User').default.deleteMessagesFromFolderWithoutCheck(self.draftFolder(), [self.draftUid()]);
kn.hideScreenPopup(ComposePopupView);
}
}]);
}
}, function () {
return this.isDraftFolderMessage();