Commit 784ab498 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Поправил selector (чтобы были стили как в меню).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55591 954022d7-b5bf-4e40-9824-e11837661b57
parent 04c162ab
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
height: 11pt; height: 11pt;
} }
#apiPopUpSelector { /*#apiPopUpSelector {
z-index: 3000; z-index: 3000;
height: auto; height: auto;
background-color: #FFF; background-color: #FFF;
...@@ -150,17 +150,17 @@ ...@@ -150,17 +150,17 @@
margin: 0 10px 0 0; margin: 0 10px 0 0;
padding: 0; padding: 0;
list-style: none; list-style: none;
} }*/
#apiPopUpList li { #apiPopUpList li {
max-width: 500px; max-width: 500px;
text-overflow: ellipsis; /*text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;*/
} }
#apiPopUpList li:hover { /*#apiPopUpList li:hover {
background-color: #D8DADC; background-color: #D8DADC;
} }
#apiPopUpList li.selected { #apiPopUpList li.selected {
background-color: #7d858c; background-color: #7d858c;
color: #fff; color: #fff;
} }*/
\ No newline at end of file \ No newline at end of file
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
this.selector = document.createElement("div"); this.selector = document.createElement("div");
this.selectorStyle = this.selector.style; this.selectorStyle = this.selector.style;
this.selector.id = "apiPopUpSelector"; this.selector.id = "apiPopUpSelector";
this.selector.className = "dropdown-menu"; // Необходимо для меню
this.selector.innerHTML = '<div style="max-height:210px;overflow-y:auto"><ul id="apiPopUpList"></ul></div>'; this.selector.innerHTML = '<div style="max-height:210px;overflow-y:auto"><ul id="apiPopUpList"></ul></div>';
this.element.appendChild(this.selector); this.element.appendChild(this.selector);
...@@ -76,7 +77,7 @@ ...@@ -76,7 +77,7 @@
} }
this.isFormula = isFormula; this.isFormula = isFormula;
var item, isFirst; var item, isFirst, value;
for (var i = 0; i < arrItems.length; ++i) { for (var i = 0; i < arrItems.length; ++i) {
item = document.createElement("li"); item = document.createElement("li");
isFirst = (0 === i); isFirst = (0 === i);
...@@ -88,10 +89,14 @@ ...@@ -88,10 +89,14 @@
this.selectElement = item; this.selectElement = item;
item.className = "selected"; item.className = "selected";
} }
item.innerHTML = arrItems[i].name;
value = arrItems[i].name;
item.setAttribute("title", arrItems[i].arg); item.setAttribute("title", arrItems[i].arg);
} else } else
item.innerHTML = arrItems[i]; value = arrItems[i];
item.innerHTML = "<a>" + value + "</a>";
item.setAttribute("val", value);
if (item.addEventListener) { if (item.addEventListener) {
item.addEventListener("mousedown" , this.fMouseDown , false); item.addEventListener("mousedown" , this.fMouseDown , false);
...@@ -149,7 +154,7 @@ ...@@ -149,7 +154,7 @@
break; break;
case 13: // "enter" case 13: // "enter"
if (!this.isFormula && null !== this.selectElement) if (!this.isFormula && null !== this.selectElement)
this._onInsert(this.selectElement.innerHTML); this._onInsert(this.selectElement.getAttribute("val"));
else else
retVal = true; retVal = true;
break; break;
...@@ -183,7 +188,7 @@ ...@@ -183,7 +188,7 @@
if (this.isFormula) { if (this.isFormula) {
this._onChangeSelection(element); this._onChangeSelection(element);
} else { } else {
this._onInsert(element.innerHTML); this._onInsert(element.getAttribute("val"));
} }
}; };
PopUpSelector.prototype._onMouseDblClick = function (event) { PopUpSelector.prototype._onMouseDblClick = function (event) {
...@@ -194,7 +199,7 @@ ...@@ -194,7 +199,7 @@
this._onMouseDown(event); this._onMouseDown(event);
return; return;
} }
var elementVal = (event ? (event.target || event.srcElement) : this.selectElement).innerHTML + "("; var elementVal = (event ? (event.target || event.srcElement) : this.selectElement).getAttribute("val") + "(";
this._onInsert(elementVal); this._onInsert(elementVal);
}; };
PopUpSelector.prototype._onMouseOver = function (event) { PopUpSelector.prototype._onMouseOver = function (event) {
......
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