Commit b303c38d authored by Julia Radzhabova's avatar Julia Radzhabova

Fixed bug: change focus from text field or textarea to another text field or...

Fixed bug: change focus from text field or textarea to another text field or textarea (e.g. click to fiedls in the search dialog in replace mode).
parent 0a4a5c9a
......@@ -163,8 +163,10 @@ define([
$(document.body).on('blur', 'input, textarea', function(e) {
if (!me.isModalShowed) {
if (!/area_id/.test(e.target.id) && $(e.target).parent().find(e.relatedTarget).length<1 /* When focus in combobox goes from input to it's menu button or menu items */
|| !e.relatedTarget) {
if (!e.relatedTarget ||
!/area_id/.test(e.target.id) && $(e.target).parent().find(e.relatedTarget).length<1 /* Check if focus in combobox goes from input to it's menu button or menu items */
&& (e.relatedTarget.localName != 'input' || !/form-control/.test(e.relatedTarget.className)) /* Check if focus goes to text input with class "form-control" */
&& (e.relatedTarget.localName != 'textarea' || /area_id/.test(e.relatedTarget.id))) /* Check if focus goes to textarea, but not to "area_id" */ {
me.api.asc_enableKeyEvents(true);
if (/msg-reply/.test(e.target.className))
me.dontCloseDummyComment = false;
......
......@@ -151,8 +151,10 @@ define([
$(document.body).on('blur', 'input, textarea', function(e) {
if (!me.isModalShowed) {
if (!/area_id/.test(e.target.id) && $(e.target).parent().find(e.relatedTarget).length<1 /* When focus in combobox goes from input to it's menu button or menu items */
|| !e.relatedTarget) {
if (!e.relatedTarget ||
!/area_id/.test(e.target.id) && $(e.target).parent().find(e.relatedTarget).length<1 /* Check if focus in combobox goes from input to it's menu button or menu items */
&& (e.relatedTarget.localName != 'input' || !/form-control/.test(e.relatedTarget.className)) /* Check if focus goes to text input with class "form-control" */
&& (e.relatedTarget.localName != 'textarea' || /area_id/.test(e.relatedTarget.id))) /* Check if focus goes to textarea, but not to "area_id" */ {
me.api.asc_enableKeyEvents(true);
if (/msg-reply/.test(e.target.className))
me.dontCloseDummyComment = false;
......
......@@ -159,12 +159,15 @@ define([
$(document.body).on('blur', 'input, textarea', function(e) {
if (this.isAppDisabled === true) return;
if (!me.isModalShowed && !(me.loadMask && me.loadMask.isVisible()) &&
(!/area_id/.test(e.target.id) && $(e.target).parent().find(e.relatedTarget).length<1 /* When focus in combobox goes from input to it's menu button or menu items */
|| !e.relatedTarget)) {
me.api.asc_enableKeyEvents(true);
if (/msg-reply/.test(e.target.className))
me.dontCloseDummyComment = false;
if (!me.isModalShowed && !(me.loadMask && me.loadMask.isVisible())) {
if (!e.relatedTarget ||
!/area_id/.test(e.target.id) && $(e.target).parent().find(e.relatedTarget).length<1 /* Check if focus in combobox goes from input to it's menu button or menu items */
&& (e.relatedTarget.localName != 'input' || !/form-control/.test(e.relatedTarget.className)) /* Check if focus goes to text input with class "form-control" */
&& (e.relatedTarget.localName != 'textarea' || /area_id/.test(e.relatedTarget.id))) /* Check if focus goes to textarea, but not to "area_id" */ {
me.api.asc_enableKeyEvents(true);
if (/msg-reply/.test(e.target.className))
me.dontCloseDummyComment = false;
}
}
}).on('dragover', function(e) {
var event = e.originalEvent;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment