diff --git a/apps/common/main/lib/component/FocusManager.js b/apps/common/main/lib/component/FocusManager.js index 1158d4b5a..24b62cb43 100644 --- a/apps/common/main/lib/component/FocusManager.js +++ b/apps/common/main/lib/component/FocusManager.js @@ -129,45 +129,48 @@ Common.UI.FocusManager = new(function() { } }; - Common.NotificationCenter.on({ - 'modal:show': function(e){ - if (e && e.cid) { - if (_windows[e.cid]) { - _windows[e.cid].hidden = false; - } else { - _windows[e.cid] = { - parent: e, - hidden: false, - index: _count++ - }; - updateTabIndexes(true); + var _init = function() { + Common.NotificationCenter.on({ + 'modal:show': function(e){ + if (e && e.cid) { + if (_windows[e.cid]) { + _windows[e.cid].hidden = false; + } else { + _windows[e.cid] = { + parent: e, + hidden: false, + index: _count++ + }; + 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 { + init: _init, add: _add } })(); \ No newline at end of file diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index ecacd9dae..be6c9ebcc 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -170,6 +170,8 @@ define([ window["flat_desine"] = true; this.api = this.getApplication().getController('Viewport').getApi(); + Common.UI.FocusManager.init(); + if (this.api){ this.api.SetDrawingFreeze(true); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index e25a425ea..34f2b9395 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -155,6 +155,8 @@ define([ window["flat_desine"] = true; this.api = this.getApplication().getController('Viewport').getApi(); + Common.UI.FocusManager.init(); + if (this.api){ this.api.SetDrawingFreeze(true); this.api.SetThemesPath("../../../../sdkjs/slide/themes/"); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 8d8f8e859..183eb4510 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -165,6 +165,8 @@ define([ // Initialize api this.api = this.getApplication().getController('Viewport').getApi(); + Common.UI.FocusManager.init(); + var value = Common.localStorage.getBool("sse-settings-cachemode", true); Common.Utils.InternalSettings.set("sse-settings-cachemode", value); this.api.asc_setDefaultBlitMode(!!value);