loleaflet: don't add reply on Cancel, don't leave empty box
Reply was added when clicking Cancel. This is a regression from
0760786392
Additionally, when focus was lost on an empty, initial commit,
an empty, defunct comment box remained until reload.
Change-Id: I49a5224ff70de65623496cfcba538acb6a8086f8
Reviewed-on: https://gerrit.libreoffice.org/40915
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
This commit is contained in:
parent
894c5f2cc2
commit
a75b780b8a
1 changed files with 5 additions and 0 deletions
|
@ -217,6 +217,7 @@ L.Annotation = L.Layer.extend({
|
|||
_onCancelClick: function (e) {
|
||||
L.DomEvent.stopPropagation(e);
|
||||
this._nodeModifyText.value = this._contentText.origText;
|
||||
this._nodeReplyText.value = '';
|
||||
this.show();
|
||||
this._map.fire('AnnotationCancel', {annotation: this});
|
||||
},
|
||||
|
@ -233,6 +234,10 @@ L.Annotation = L.Layer.extend({
|
|||
if (this._contentText.origText !== this._nodeModifyText.value) {
|
||||
this._onSaveComment(e);
|
||||
}
|
||||
else if (this._nodeModifyText.value == '') {
|
||||
// Implies that this._contentText.origText == ''
|
||||
this._onCancelClick(e);
|
||||
}
|
||||
},
|
||||
|
||||
_onLostFocusReply: function(e) {
|
||||
|
|
Loading…
Reference in a new issue