Fix Bug 47277

This commit is contained in:
Julia Radzhabova 2020-11-06 12:00:43 +03:00
parent c713710592
commit 1a644365a0
4 changed files with 44 additions and 35 deletions

View file

@ -129,45 +129,48 @@ Common.UI.FocusManager = new(function() {
} }
}; };
Common.NotificationCenter.on({ var _init = function() {
'modal:show': function(e){ Common.NotificationCenter.on({
if (e && e.cid) { 'modal:show': function(e){
if (_windows[e.cid]) { if (e && e.cid) {
_windows[e.cid].hidden = false; if (_windows[e.cid]) {
} else { _windows[e.cid].hidden = false;
_windows[e.cid] = { } else {
parent: e, _windows[e.cid] = {
hidden: false, parent: e,
index: _count++ hidden: false,
}; index: _count++
updateTabIndexes(true); };
updateTabIndexes(true);
}
}
},
'window:show': function(e){
if (e && e.cid && _windows[e.cid] && !_windows[e.cid].fields) {
_windows[e.cid].fields = register(e.getFocusedComponents());
addTraps(_windows[e.cid]);
}
var el = e ? e.getDefaultFocusableComponent() : null;
el && setTimeout(function(){ el.focus(); }, 100);
},
'modal:close': function(e, last) {
if (e && e.cid && _windows[e.cid]) {
updateTabIndexes(false);
delete _windows[e.cid];
_count--;
}
},
'modal:hide': function(e, last) {
if (e && e.cid && _windows[e.cid]) {
_windows[e.cid].hidden = true;
} }
} }
}, });
'window:show': function(e){ };
if (e && e.cid && _windows[e.cid] && !_windows[e.cid].fields) {
_windows[e.cid].fields = register(e.getFocusedComponents());
addTraps(_windows[e.cid]);
}
var el = e ? e.getDefaultFocusableComponent() : null;
el && setTimeout(function(){ el.focus(); }, 100);
},
'modal:close': function(e, last) {
if (e && e.cid && _windows[e.cid]) {
updateTabIndexes(false);
delete _windows[e.cid];
_count--;
}
},
'modal:hide': function(e, last) {
if (e && e.cid && _windows[e.cid]) {
_windows[e.cid].hidden = true;
}
}
});
return { return {
init: _init,
add: _add add: _add
} }
})(); })();

View file

@ -170,6 +170,8 @@ define([
window["flat_desine"] = true; window["flat_desine"] = true;
this.api = this.getApplication().getController('Viewport').getApi(); this.api = this.getApplication().getController('Viewport').getApi();
Common.UI.FocusManager.init();
if (this.api){ if (this.api){
this.api.SetDrawingFreeze(true); this.api.SetDrawingFreeze(true);

View file

@ -155,6 +155,8 @@ define([
window["flat_desine"] = true; window["flat_desine"] = true;
this.api = this.getApplication().getController('Viewport').getApi(); this.api = this.getApplication().getController('Viewport').getApi();
Common.UI.FocusManager.init();
if (this.api){ if (this.api){
this.api.SetDrawingFreeze(true); this.api.SetDrawingFreeze(true);
this.api.SetThemesPath("../../../../sdkjs/slide/themes/"); this.api.SetThemesPath("../../../../sdkjs/slide/themes/");

View file

@ -165,6 +165,8 @@ define([
// Initialize api // Initialize api
this.api = this.getApplication().getController('Viewport').getApi(); this.api = this.getApplication().getController('Viewport').getApi();
Common.UI.FocusManager.init();
var value = Common.localStorage.getBool("sse-settings-cachemode", true); var value = Common.localStorage.getBool("sse-settings-cachemode", true);
Common.Utils.InternalSettings.set("sse-settings-cachemode", value); Common.Utils.InternalSettings.set("sse-settings-cachemode", value);
this.api.asc_setDefaultBlitMode(!!value); this.api.asc_setDefaultBlitMode(!!value);