Re-use the auto suggestion box and make sure it's not overlapped
This commit is contained in:
parent
cbfe1504b0
commit
e1b82af2c7
2 changed files with 13 additions and 5 deletions
|
@ -5,6 +5,7 @@ div.suggestions {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
z-index: 999;
|
||||||
}
|
}
|
||||||
div.suggestions div {
|
div.suggestions div {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
|
|
|
@ -53,12 +53,18 @@ AutoSuggestControl.prototype.autosuggest = function (aSuggestions /*:Array*/) {
|
||||||
AutoSuggestControl.prototype.createDropDown = function () {
|
AutoSuggestControl.prototype.createDropDown = function () {
|
||||||
var oThis = this;
|
var oThis = this;
|
||||||
|
|
||||||
//create the layer and assign styles
|
var sDiv = document.getElementById("suggestions_box");
|
||||||
|
|
||||||
|
if (sDiv)
|
||||||
|
this.layer = sDiv;
|
||||||
|
else
|
||||||
|
{
|
||||||
this.layer = document.createElement("div");
|
this.layer = document.createElement("div");
|
||||||
this.layer.className = "suggestions";
|
this.layer.className = "suggestions";
|
||||||
|
this.layer.id = "suggestions_box";
|
||||||
this.layer.style.visibility = "hidden";
|
this.layer.style.visibility = "hidden";
|
||||||
this.layer.style.width = this.textbox.offsetWidth;
|
this.layer.style.width = this.textbox.offsetWidth;
|
||||||
|
}
|
||||||
this.layer.onmousedown =
|
this.layer.onmousedown =
|
||||||
this.layer.onmouseup =
|
this.layer.onmouseup =
|
||||||
this.layer.onmouseover = function (oEvent) {
|
this.layer.onmouseover = function (oEvent) {
|
||||||
|
@ -275,6 +281,7 @@ AutoSuggestControl.prototype.showSuggestions = function (aSuggestions /*:Array*/
|
||||||
this.layer.style.left = this.getLeft() + "px";
|
this.layer.style.left = this.getLeft() + "px";
|
||||||
this.layer.style.top = (this.getTop()+this.textbox.offsetHeight) + "px";
|
this.layer.style.top = (this.getTop()+this.textbox.offsetHeight) + "px";
|
||||||
this.layer.style.visibility = "visible";
|
this.layer.style.visibility = "visible";
|
||||||
|
this.layer.style.position = "absolute";
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue