[DE mobile] Comments (add modal comfirm when detele comment/draft)

This commit is contained in:
JuliaSvinareva 2020-04-07 17:28:12 +03:00
parent 37007d9005
commit 61193b2f6a
3 changed files with 42 additions and 4 deletions

View file

@ -1288,7 +1288,20 @@ define([
break; break;
case 'delete': case 'delete':
addOverlay(); addOverlay();
me.onDeleteComment(idComment); uiApp.modal({
title: this.textDeleteComment,
text: this.textMessageDeleteComment,
buttons: [
{
text: this.textCancel
},
{
text: this.textYes,
onClick: function () {
me.onDeleteComment(idComment);
}
}]
});
me.disabledViewComments(false); me.disabledViewComments(false);
break; break;
case 'editreply': case 'editreply':
@ -1998,7 +2011,9 @@ define([
textEditComment: 'Edit comment', textEditComment: 'Edit comment',
textDeleteReply: 'Delete reply', textDeleteReply: 'Delete reply',
textEditReply: 'Edit reply', textEditReply: 'Edit reply',
textReopen: 'Reopen' textReopen: 'Reopen',
textMessageDeleteComment: 'Do you really want to delete this comment?',
textYes: 'Yes'
} }
})(), Common.Controllers.Collaboration || {})) })(), Common.Controllers.Collaboration || {}))

View file

@ -119,6 +119,26 @@ define([
if (comment) { if (comment) {
this.getView('AddOther').renderComment(comment); this.getView('AddOther').renderComment(comment);
$('#done-comment').single('click', _.bind(this.onDoneComment, this)); $('#done-comment').single('click', _.bind(this.onDoneComment, this));
$('.back-from-add-comment').single('click', _.bind(function () {
if ($('#comment-text').val().length > 0) {
uiApp.modal({
title: '',
text: this.textDeleteDraft,
buttons: [
{
text: this.textCancel
},
{
text: this.textContinue,
onClick: function () {
DE.getController('AddContainer').rootView.router.back();
}
}]
})
} else {
DE.getController('AddContainer').rootView.router.back();
}
}, this))
} }
}, },
@ -384,7 +404,10 @@ define([
txtNotUrl: 'This field should be a URL in the format \"http://www.example.com\"', txtNotUrl: 'This field should be a URL in the format \"http://www.example.com\"',
textBottomOfPage: 'Bottom Of Page', textBottomOfPage: 'Bottom Of Page',
textBelowText: 'Below Text' textBelowText: 'Below Text',
textDeleteDraft: 'Delete draft?',
textCancel: 'Cancel',
textContinue: 'Continue'
} }
})(), DE.Controllers.AddOther || {})) })(), DE.Controllers.AddOther || {}))

View file

@ -342,7 +342,7 @@
<div id="addother-insert-comment"> <div id="addother-insert-comment">
<div class="navbar"> <div class="navbar">
<div class="navbar-inner"> <div class="navbar-inner">
<div class="left sliding"><a href="#" class="back link"><i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %></a></div> <div class="left sliding"><a href="#" class="back-from-add-comment link"><i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textAddComment %></div> <div class="center sliding"><%= scope.textAddComment %></div>
<div class="right sliding"><a id="done-comment"><% if (android) { %><i class="icon icon-done-comment-white"></i><% } else { %><%= scope.textDone %><% } %></a></div> <div class="right sliding"><a id="done-comment"><% if (android) { %><i class="icon icon-done-comment-white"></i><% } else { %><%= scope.textDone %><% } %></a></div>
</div> </div>