loleaflet: Commit reply comment when focus lost
Change-Id: I0a47c6b74afed31264aec06ab654063fb5beaca8
This commit is contained in:
parent
759b0945d4
commit
0760786392
1 changed files with 7 additions and 0 deletions
|
@ -191,6 +191,7 @@ L.Annotation = L.Layer.extend({
|
|||
|
||||
buttons = L.DomUtil.create(tagDiv, empty, this._nodeModify);
|
||||
L.DomEvent.on(this._nodeModifyText, 'blur', this._onLostFocus, this);
|
||||
L.DomEvent.on(this._nodeReplyText, 'blur', this._onLostFocusReply, this);
|
||||
this._createButton(buttons, _('Save'), this._onSaveComment);
|
||||
this._createButton(buttons, cancel, this._onCancelClick);
|
||||
buttons = L.DomUtil.create(tagDiv, empty, this._nodeReply);
|
||||
|
@ -231,6 +232,12 @@ L.Annotation = L.Layer.extend({
|
|||
}
|
||||
},
|
||||
|
||||
_onLostFocusReply: function(e) {
|
||||
if (this._nodeReplyText.value !== '') {
|
||||
this._onReplyClick(e);
|
||||
}
|
||||
},
|
||||
|
||||
_onMouseClick: function (e) {
|
||||
var target = e.target || e.srcElement;
|
||||
L.DomEvent.stopPropagation(e);
|
||||
|
|
Loading…
Reference in a new issue