Commit c931112e authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

FormulaSelector: исправлена часть багов с кроссплатформенностью

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55056 954022d7-b5bf-4e40-9824-e11837661b57
parent 74d7ab31
...@@ -1701,17 +1701,22 @@ ...@@ -1701,17 +1701,22 @@
selector.style["cursor"] = "default"; selector.style["cursor"] = "default";
selector.style["font-size"] = "12px"; selector.style["font-size"] = "12px";
selector.style["padding"] = "4px"; selector.style["padding"] = "4px";
selector.style["fontSize"] = "12px";
document.body.appendChild(selector); document.body.appendChild(selector);
var combo = document.createElement("ul"); var combo = document.createElement("ul");
combo.id = "formulaList"; combo.id = "formulaList";
combo.style["margin"] = 0; combo.style["margin"] = 0;
combo.style["padding"] = 0; combo.style["padding"] = 0;
combo.style["listStyle"] = "none";
combo.style["listImage"] = "none";
selector.appendChild(combo); selector.appendChild(combo);
for ( var i = 0; i < formulaList.list.length; i++ ) { for ( var i = 0; i < formulaList.list.length; i++ ) {
var item = document.createElement("li"); var item = document.createElement("li");
item.style["list-style-type"] = "none"; if ( item.textContent != undefined )
item.textContent = formulaList.list[i].name;
else
item.innerText = formulaList.list[i].name; item.innerText = formulaList.list[i].name;
item.setAttribute("title", formulaList.list[i].arg); item.setAttribute("title", formulaList.list[i].arg);
...@@ -1743,7 +1748,7 @@ ...@@ -1743,7 +1748,7 @@
_removeFormulaSelector: function() { _removeFormulaSelector: function() {
var selector = document.getElementById("formulaSelector"); var selector = document.getElementById("formulaSelector");
if ( selector ) if ( selector )
selector.remove(); selector.parentNode.removeChild(selector);
}, },
_updateFormulaSelectorPosition: function() { _updateFormulaSelectorPosition: function() {
...@@ -1830,7 +1835,7 @@ ...@@ -1830,7 +1835,7 @@
{ {
for ( var i = 0; i < nodes.length; i++ ) { for ( var i = 0; i < nodes.length; i++ ) {
if ( nodes[i].style["backgroundColor"] != "" ) { if ( nodes[i].style["backgroundColor"] != "" ) {
var formulaName = nodes[i].innerText; var formulaName = nodes[i].innerText || nodes[i].textContent;
var insertText = formulaName.substring(_this.input.value.length - 1) + "("; var insertText = formulaName.substring(_this.input.value.length - 1) + "(";
_this._addChars(insertText); _this._addChars(insertText);
_this._removeFormulaSelector(); _this._removeFormulaSelector();
......
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