Commit 8b3032dd authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Ушел от dataHandler в сторону switch (работает быстрее): http://jsperf.com/testfunctionrun

Вынес работу в функции (из глобальных в класс)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56548 954022d7-b5bf-4e40-9824-e11837661b57
parent 2aa4d399
This diff is collapsed.
......@@ -153,7 +153,9 @@
//Get data type
var dataObject = JSON.parse(e.data);
var type = dataObject.type;
docsCoApi.dataHandler[type](dataObject);
switch (type) {
case 'spellCheck' : docsCoApi._onSpellCheck(dataObject); break;
}
};
sockjs.onclose = function (evt) {
docsCoApi._state = -1; // Reconnect state
......@@ -194,12 +196,6 @@
var docsCoApi = this;
this.sockjs_url = this._url + '/doc/'+docid+'/c';
this.sockjs = initSocksJs(this.sockjs_url, this);
this.dataHandler = {
"spellCheck":function (data) {
docsCoApi._onSpellCheck(data);
}
};
};
global["CSpellCheckApi"] = CSpellCheckApi;
......
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