Fixed bugs with focus and keydown events in menus.
This commit is contained in:
parent
1ccae8d386
commit
e6e7be6f84
|
@ -1079,7 +1079,6 @@ define([
|
|||
if (dialog) {
|
||||
if (this.popoverComments.length) {
|
||||
_.delay(function() {
|
||||
me.api.asc_enableKeyEvents(false);
|
||||
dialog.commentsView.setFocusToTextBox();
|
||||
}, 200);
|
||||
return;
|
||||
|
@ -1234,7 +1233,6 @@ define([
|
|||
var panel = $('.new-comment-ct', this.view.el);
|
||||
if (panel && panel.length) {
|
||||
if ('none' !== panel.css('display')) {
|
||||
this.api.asc_enableKeyEvents(false);
|
||||
this.view.txtComment.focus();
|
||||
}
|
||||
|
||||
|
|
|
@ -155,18 +155,11 @@ define([
|
|||
// Syncronize focus with api
|
||||
$(document.body).on('focus', 'input, textarea', function(e) {
|
||||
if (!/area_id/.test(e.target.id)) {
|
||||
me.api.asc_enableKeyEvents(false);
|
||||
if (/msg-reply/.test(e.target.className))
|
||||
me.dontCloseDummyComment = true;
|
||||
}
|
||||
});
|
||||
|
||||
$("#editor_sdk").focus(function (e) {
|
||||
if (!me.isModalShowed) {
|
||||
me.api.asc_enableKeyEvents(true);
|
||||
}
|
||||
});
|
||||
|
||||
$(document.body).on('blur', 'input, textarea', function(e) {
|
||||
if (!me.isModalShowed) {
|
||||
/*
|
||||
|
@ -207,16 +200,13 @@ define([
|
|||
},
|
||||
'settings:unitschanged':_.bind(this.unitsChanged, this),
|
||||
'dataview:focus': function(e){
|
||||
me.api.asc_enableKeyEvents(false);
|
||||
},
|
||||
'dataview:blur': function(e){
|
||||
if (!me.isModalShowed) {
|
||||
me.api.asc_enableKeyEvents(true);
|
||||
me.onEditComplete();
|
||||
}
|
||||
},
|
||||
'menu:show': function(e){
|
||||
me.api.asc_enableKeyEvents(false);
|
||||
},
|
||||
'menu:hide': function(e){
|
||||
if (!me.isModalShowed)
|
||||
|
|
|
@ -1107,7 +1107,6 @@ define([
|
|||
msg: this.textFontSizeErr,
|
||||
callback: function() {
|
||||
_.defer(function(btn) {
|
||||
me.api.asc_enableKeyEvents(false);
|
||||
$('input', combo.cmpEl).focus();
|
||||
})
|
||||
}
|
||||
|
|
|
@ -110,9 +110,6 @@ define([
|
|||
menu.alignPosition();
|
||||
}
|
||||
_.delay(function() {
|
||||
var value = Common.localStorage.getItem("de-settings-inputmode"); // only for hieroglyphs mode
|
||||
if (value!==null && parseInt(value) == 1)
|
||||
me.api.asc_enableKeyEvents(false);
|
||||
menu.cmpEl.focus();
|
||||
}, 10);
|
||||
|
||||
|
@ -1616,7 +1613,6 @@ define([
|
|||
addComment: function(item, e, eOpt){
|
||||
if (this.api && this.mode.canCoAuthoring && this.mode.isEdit && this.mode.canComments) {
|
||||
this.suppressEditComplete = true;
|
||||
this.api.asc_enableKeyEvents(false);
|
||||
|
||||
var controller = DE.getController('Common.Controllers.Comments');
|
||||
if (controller) {
|
||||
|
|
|
@ -208,7 +208,6 @@ define([
|
|||
this.btnLanguage.cmpEl.on({
|
||||
'show.bs.dropdown': function () {
|
||||
_.defer(function(){
|
||||
me.api.asc_enableKeyEvents(false);
|
||||
me.btnLanguage.cmpEl.find('ul').focus();
|
||||
}, 100);
|
||||
},
|
||||
|
@ -234,7 +233,6 @@ define([
|
|||
});
|
||||
this.cntZoom.cmpEl.on('show.bs.dropdown', function () {
|
||||
_.defer(function(){
|
||||
me.api.asc_enableKeyEvents(false);
|
||||
me.cntZoom.cmpEl.find('ul').focus();
|
||||
}, 100);
|
||||
}
|
||||
|
|
|
@ -138,17 +138,11 @@ define([
|
|||
// Syncronize focus with api
|
||||
$(document.body).on('focus', 'input, textarea', function(e) {
|
||||
if (!/area_id/.test(e.target.id)) {
|
||||
me.api.asc_enableKeyEvents(false);
|
||||
if (/msg-reply/.test(e.target.className))
|
||||
me.dontCloseDummyComment = true;
|
||||
}
|
||||
});
|
||||
|
||||
$("#editor_sdk").focus(function (e) {
|
||||
if (!me.isModalShowed)
|
||||
me.api.asc_enableKeyEvents(true);
|
||||
});
|
||||
|
||||
$(document.body).on('blur', 'input, textarea', function(e) {
|
||||
if (!me.isModalShowed) {
|
||||
/*
|
||||
|
@ -189,16 +183,13 @@ define([
|
|||
},
|
||||
'settings:unitschanged':_.bind(this.unitsChanged, this),
|
||||
'dataview:focus': function(e){
|
||||
me.api.asc_enableKeyEvents(false);
|
||||
},
|
||||
'dataview:blur': function(e){
|
||||
if (!me.isModalShowed) {
|
||||
me.api.asc_enableKeyEvents(true);
|
||||
me.onEditComplete();
|
||||
}
|
||||
},
|
||||
'menu:show': function(e){
|
||||
me.api.asc_enableKeyEvents(false);
|
||||
},
|
||||
'menu:hide': function(e){
|
||||
if (!me.isModalShowed)
|
||||
|
|
|
@ -1106,7 +1106,6 @@ define([
|
|||
msg: this.textFontSizeErr,
|
||||
callback: function() {
|
||||
_.defer(function(btn) {
|
||||
me.api.asc_enableKeyEvents(false);
|
||||
$('input', combo.cmpEl).focus();
|
||||
})
|
||||
}
|
||||
|
|
|
@ -101,9 +101,6 @@ define([
|
|||
menu.alignPosition();
|
||||
}
|
||||
_.delay(function() {
|
||||
var value = Common.localStorage.getItem("pe-settings-inputmode"); // only for hieroglyphs mode
|
||||
if (value!==null && parseInt(value) == 1)
|
||||
me.api.asc_enableKeyEvents(false);
|
||||
menu.cmpEl.focus();
|
||||
}, 10);
|
||||
|
||||
|
@ -813,7 +810,6 @@ define([
|
|||
addComment: function(item, e, eOpt){
|
||||
if (this.api && this.mode.canCoAuthoring && this.mode.isEdit && this.mode.canComments) {
|
||||
this.suppressEditComplete = true;
|
||||
this.api.asc_enableKeyEvents(false);
|
||||
|
||||
var controller = PE.getController('Common.Controllers.Comments');
|
||||
if (controller) {
|
||||
|
|
|
@ -137,7 +137,6 @@ define([
|
|||
});
|
||||
this.cntZoom.cmpEl.on('show.bs.dropdown', function () {
|
||||
_.defer(function(){
|
||||
me.api.asc_enableKeyEvents(false);
|
||||
me.cntZoom.cmpEl.find('ul').focus();
|
||||
}, 100);
|
||||
}
|
||||
|
|
|
@ -217,7 +217,6 @@ define([
|
|||
var controller = this.getApplication().getController('FormulaDialog');
|
||||
if (controller) {
|
||||
$('#ce-func-label', this.editor.el).blur();
|
||||
this.api.asc_enableKeyEvents(false);
|
||||
controller.showDialog();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -419,7 +419,6 @@ define([
|
|||
onInsFunction: function(item) {
|
||||
var controller = this.getApplication().getController('FormulaDialog');
|
||||
if (controller && this.api) {
|
||||
this.api.asc_enableKeyEvents(false);
|
||||
controller.showDialog();
|
||||
}
|
||||
},
|
||||
|
@ -517,7 +516,6 @@ define([
|
|||
|
||||
onAddComment: function(item) {
|
||||
if (this.api && this.permissions.canCoAuthoring && this.permissions.isEdit && this.permissions.canComments) {
|
||||
this.api.asc_enableKeyEvents(false);
|
||||
|
||||
var controller = SSE.getController('Common.Controllers.Comments'),
|
||||
cellinfo = this.api.asc_getCellInfo();
|
||||
|
|
|
@ -156,12 +156,6 @@ define([
|
|||
}
|
||||
});
|
||||
|
||||
$("#editor_sdk").focus(function (e) {
|
||||
if (this.isAppDisabled === true) return;
|
||||
if (!me.isModalShowed)
|
||||
me.api.asc_enableKeyEvents(true);
|
||||
});
|
||||
|
||||
$(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) &&
|
||||
|
@ -197,20 +191,17 @@ define([
|
|||
}
|
||||
},
|
||||
'dataview:focus': function(e){
|
||||
// me.api.asc_enableKeyEvents(false);
|
||||
},
|
||||
'dataview:blur': function(e){
|
||||
if (!me.isModalShowed) {
|
||||
// me.api.asc_enableKeyEvents(true);
|
||||
me.onEditComplete();
|
||||
me.api.asc_enableKeyEvents(true);
|
||||
}
|
||||
},
|
||||
'menu:show': function(e){
|
||||
// me.api.asc_enableKeyEvents(false);
|
||||
},
|
||||
'menu:hide': function(e){
|
||||
// if (!me.isModalShowed)
|
||||
// me.api.asc_enableKeyEvents(true);
|
||||
if (!me.isModalShowed)
|
||||
me.api.asc_enableKeyEvents(true);
|
||||
},
|
||||
'edit:complete': _.bind(this.onEditComplete, this),
|
||||
'settings:unitschanged':_.bind(this.unitsChanged, this)
|
||||
|
|
|
@ -878,7 +878,6 @@ define([
|
|||
if (item.value === 'more') {
|
||||
var controller = this.getApplication().getController('FormulaDialog');
|
||||
if (controller) {
|
||||
this.api.asc_enableKeyEvents(false);
|
||||
controller.showDialog();
|
||||
}
|
||||
} else {
|
||||
|
@ -1082,7 +1081,6 @@ define([
|
|||
msg: this.textFontSizeErr,
|
||||
callback: function() {
|
||||
_.defer(function(btn) {
|
||||
me.api.asc_enableKeyEvents(false);
|
||||
$('input', combo.cmpEl).focus();
|
||||
})
|
||||
}
|
||||
|
|
|
@ -150,7 +150,6 @@ define([
|
|||
this.cntZoom.cmpEl.on({
|
||||
'show.bs.dropdown': function () {
|
||||
_.defer(function(){
|
||||
me.api.asc_enableKeyEvents(false);
|
||||
me.cntZoom.cmpEl.find('ul').focus();
|
||||
}, 100);
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue