From: Aleksander Ɓukasz Date: Wed, 28 May 2014 09:17:18 +0000 (+0200) Subject: editor: gutter comments - delete comment confirmation dialog X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/2b589ff1348083317b6fba787c1b4fd61eecf8c9?ds=inline;hp=-c editor: gutter comments - delete comment confirmation dialog --- 2b589ff1348083317b6fba787c1b4fd61eecf8c9 diff --git a/src/editor/modules/documentCanvas/canvas/comments/comment.html b/src/editor/modules/documentCanvas/canvas/comments/comment.html index 68c14c1..3e9fb28 100644 --- a/src/editor/modules/documentCanvas/canvas/comments/comment.html +++ b/src/editor/modules/documentCanvas/canvas/comments/comment.html @@ -19,4 +19,11 @@ <%= gettext('edit') %> - <%= gettext('remove') %> +
+
<%= gettext('Delete this comment?') %>
+
+ + +
+
diff --git a/src/editor/modules/documentCanvas/canvas/comments/comments.js b/src/editor/modules/documentCanvas/canvas/comments/comments.js index 692c0b7..632616b 100644 --- a/src/editor/modules/documentCanvas/canvas/comments/comments.js +++ b/src/editor/modules/documentCanvas/canvas/comments/comments.js @@ -158,8 +158,13 @@ var CommentView = function(commentNode) { this.contentElement = this.dom.find('.content'); this.editElement = this.dom.find('.edit'); + this.deleteDialogElement = this.dom.find('.deleteDialog'); this.dom.find('.remove-btn').on('click', function() { + this.deleteDialogElement.show(); + }.bind(this)); + + this.dom.find('.deleteDialog-confirm').on('click', function() { this.node.document.transaction(function() { this.node.detach(); }.bind(this), { @@ -169,6 +174,10 @@ var CommentView = function(commentNode) { }); }.bind(this)); + this.dom.find('.deleteDialog-cancel').on('click', function() { + this.deleteDialogElement.hide(); + }.bind(this)); + this.dom.find('.edit-start-btn').on('click', function() { this.startEditing(); }.bind(this)); diff --git a/src/editor/modules/documentCanvas/canvas/comments/comments.less b/src/editor/modules/documentCanvas/canvas/comments/comments.less index 140e836..4c68e64 100644 --- a/src/editor/modules/documentCanvas/canvas/comments/comments.less +++ b/src/editor/modules/documentCanvas/canvas/comments/comments.less @@ -4,6 +4,7 @@ font-size: 12px; .comment { + position: relative; border-color: @borderColor; border-style: solid; @@ -34,6 +35,19 @@ .edit { display: none; } + + .deleteDialog { + display: none; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + padding-top: 15px; + color: white; + background-color: rgba(0,0,0,0.7); + text-align: center; + } } .newComment {