[Xfce4-commits] <midori:master> Re-use the auto suggestion box and make sure it's not overlapped
Christian Dywan
noreply at xfce.org
Fri Dec 18 10:24:01 CET 2009
Updating branch refs/heads/master
to e1b82af2c7f780e1381d72aa0aa20d4d5033caf3 (commit)
from cbfe1504b0fb5f73ab56fdc80c88f4de215dc153 (commit)
commit e1b82af2c7f780e1381d72aa0aa20d4d5033caf3
Author: Alexander Butenko <a.butenka at gmail.com>
Date: Thu Dec 17 20:55:50 2009 +0100
Re-use the auto suggestion box and make sure it's not overlapped
data/autosuggestcontrol.css | 1 +
data/autosuggestcontrol.js | 17 ++++++++++++-----
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/data/autosuggestcontrol.css b/data/autosuggestcontrol.css
index a7ca89d..db1b100 100644
--- a/data/autosuggestcontrol.css
+++ b/data/autosuggestcontrol.css
@@ -5,6 +5,7 @@ div.suggestions {
text-align: left;
background-color: #ffffff;
position: absolute;
+ z-index: 999;
}
div.suggestions div {
cursor: default;
diff --git a/data/autosuggestcontrol.js b/data/autosuggestcontrol.js
index 83afeb9..fc82cbf 100644
--- a/data/autosuggestcontrol.js
+++ b/data/autosuggestcontrol.js
@@ -53,12 +53,18 @@ AutoSuggestControl.prototype.autosuggest = function (aSuggestions /*:Array*/) {
AutoSuggestControl.prototype.createDropDown = function () {
var oThis = this;
- //create the layer and assign styles
- this.layer = document.createElement("div");
- this.layer.className = "suggestions";
- this.layer.style.visibility = "hidden";
- this.layer.style.width = this.textbox.offsetWidth;
+ var sDiv = document.getElementById("suggestions_box");
+ if (sDiv)
+ this.layer = sDiv;
+ else
+ {
+ this.layer = document.createElement("div");
+ this.layer.className = "suggestions";
+ this.layer.id = "suggestions_box";
+ this.layer.style.visibility = "hidden";
+ this.layer.style.width = this.textbox.offsetWidth;
+ }
this.layer.onmousedown =
this.layer.onmouseup =
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.top = (this.getTop()+this.textbox.offsetHeight) + "px";
this.layer.style.visibility = "visible";
+ this.layer.style.position = "absolute";
};
/**
More information about the Xfce4-commits
mailing list