From 07607863925cf4fc2dbc91685d8f430f849c5535 Mon Sep 17 00:00:00 2001 From: Pranav Kant Date: Tue, 25 Apr 2017 20:27:23 +0530 Subject: [PATCH] loleaflet: Commit reply comment when focus lost Change-Id: I0a47c6b74afed31264aec06ab654063fb5beaca8 --- loleaflet/src/layer/marker/Annotation.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/loleaflet/src/layer/marker/Annotation.js b/loleaflet/src/layer/marker/Annotation.js index 4e34651ed..b5d8fbaef 100644 --- a/loleaflet/src/layer/marker/Annotation.js +++ b/loleaflet/src/layer/marker/Annotation.js @@ -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);