Commit 2e11408e authored by Alexander.Trofimov's avatar Alexander.Trofimov

init base api in derived

parent 7f7c6f78
......@@ -109,6 +109,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 );
......
......@@ -112,16 +112,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);
......@@ -139,6 +133,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 = '';
......
......@@ -2669,7 +2669,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);
}
......
......@@ -116,6 +116,8 @@ function asc_docs_api(name)
if (window["NATIVE_EDITOR_ENJINE"])
editor = window.editor;
}
this._init();
}
AscCommon.extendClass(asc_docs_api, AscCommon.baseEditorsApi);
......
......@@ -308,6 +308,8 @@ function asc_docs_api(name)
this.RevisionChangesStack = [];
//g_clipboardBase.Init(this);
this._init();
}
AscCommon.extendClass(asc_docs_api, AscCommon.baseEditorsApi);
......
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