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 @@
height: 11pt;
}
#apiPopUpSelector {
/*#apiPopUpSelector {
z-index: 3000;
height: auto;
background-color: #FFF;
......@@ -150,17 +150,17 @@
margin: 0 10px 0 0;
padding: 0;
list-style: none;
}
}*/
#apiPopUpList li {
max-width: 500px;
text-overflow: ellipsis;
/*text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
white-space: nowrap;*/
}
#apiPopUpList li:hover {
/*#apiPopUpList li:hover {
background-color: #D8DADC;
}
#apiPopUpList li.selected {
background-color: #7d858c;
color: #fff;
}
\ No newline at end of file
}*/
\ No newline at end of file
......@@ -42,6 +42,7 @@
this.selector = document.createElement("div");
this.selectorStyle = this.selector.style;
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.element.appendChild(this.selector);
......@@ -76,7 +77,7 @@
}
this.isFormula = isFormula;
var item, isFirst;
var item, isFirst, value;
for (var i = 0; i < arrItems.length; ++i) {
item = document.createElement("li");
isFirst = (0 === i);
......@@ -88,10 +89,14 @@
this.selectElement = item;
item.className = "selected";
}
item.innerHTML = arrItems[i].name;
value = arrItems[i].name;
item.setAttribute("title", arrItems[i].arg);
} else
item.innerHTML = arrItems[i];
value = arrItems[i];
item.innerHTML = "<a>" + value + "</a>";
item.setAttribute("val", value);
if (item.addEventListener) {
item.addEventListener("mousedown" , this.fMouseDown , false);
......@@ -149,7 +154,7 @@
break;
case 13: // "enter"
if (!this.isFormula && null !== this.selectElement)
this._onInsert(this.selectElement.innerHTML);
this._onInsert(this.selectElement.getAttribute("val"));
else
retVal = true;
break;
......@@ -183,7 +188,7 @@
if (this.isFormula) {
this._onChangeSelection(element);
} else {
this._onInsert(element.innerHTML);
this._onInsert(element.getAttribute("val"));
}
};
PopUpSelector.prototype._onMouseDblClick = function (event) {
......@@ -194,7 +199,7 @@
this._onMouseDown(event);
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);
};
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