diff --git a/cell/api.js b/cell/api.js index c41cf92a6f1ee2f472d7b95fd42d5539048ed5fe..18c4ce22570963dd5e9ef9d3b7073f62012e7027 100644 --- a/cell/api.js +++ b/cell/api.js @@ -133,6 +133,7 @@ var editor; }; spreadsheet_api.prototype._init = function() { + spreadsheet_api.superclass._init.call(this); this.topLineEditorElement = document.getElementById(this.topLineEditorName); // ToDo нужно ли Ñто asc['editor'] = ( asc['editor'] || this ); diff --git a/common/apiBase.js b/common/apiBase.js index d27a1891a2e055d17518fbfb048dcb9e765a55dc..48b43249a845c36647f8cce46e3b2243284656bc 100644 --- a/common/apiBase.js +++ b/common/apiBase.js @@ -136,16 +136,10 @@ function baseEditorsApi(name, editorId) { this.fCurCallback = null; - this._baseInit(); return this; } -baseEditorsApi.prototype._baseInit = function() { +baseEditorsApi.prototype._init = function() { var t = this; - AscCommon.loadSdk(this._editorNameById(), function() { - t.isLoadFullApi = true; - t._onEndLoadSdk(); - t.onEndLoadFile(null); - }); //Asc.editor = Asc['editor'] = AscCommon['editor'] = AscCommon.editor = this; // ToDo Ñделать Ñто! this.HtmlElement = document.getElementById(this.HtmlElementName); @@ -163,6 +157,12 @@ baseEditorsApi.prototype._baseInit = function() { AscCommon.InitDragAndDrop(this.HtmlElement, function(error, files) { t._uploadCallback(error, files); }); + + AscCommon.loadSdk(this._editorNameById(), function() { + t.isLoadFullApi = true; + t._onEndLoadSdk(); + t.onEndLoadFile(null); + }); }; baseEditorsApi.prototype._editorNameById = function() { var res = ''; diff --git a/common/editorscommon.js b/common/editorscommon.js index 82d9c903890e8bdbffa98c9c83855c6c08bee347..df65bc158a95eaac5b34d97c04f841cf87259316 100644 --- a/common/editorscommon.js +++ b/common/editorscommon.js @@ -2693,7 +2693,7 @@ CUserCacheColor.prototype.init = function(nColor) { } function loadSdk(sdkName, callback) { if (window['AscNotLoadAllScript']) { - setTimeout(callback, 1); + callback(); } else { loadScript('./../../../../sdkjs/' + sdkName + '/sdk-all.js', callback); } diff --git a/slide/api.js b/slide/api.js index f32f2ba6640dc9bd34631151c0fae05cfcbf523f..6f9fd00cc9367a1071d1b8bdc49b03a0faa064fe 100644 --- a/slide/api.js +++ b/slide/api.js @@ -140,6 +140,8 @@ function asc_docs_api(name) if (window["NATIVE_EDITOR_ENJINE"]) editor = window.editor; } + + this._init(); } AscCommon.extendClass(asc_docs_api, AscCommon.baseEditorsApi); diff --git a/word/api.js b/word/api.js index 92d282f2d2e1f9fc5bd8b154f8c5ea62f55f0e7e..e83b077be60fc58d75c6358f1cc83a7a4a8657e8 100644 --- a/word/api.js +++ b/word/api.js @@ -332,6 +332,8 @@ function asc_docs_api(name) this.RevisionChangesStack = []; //g_clipboardBase.Init(this); + + this._init(); } AscCommon.extendClass(asc_docs_api, AscCommon.baseEditorsApi);