]> spindle.queued.net Git - midori/commitdiff
Don't replace existing onclick/blur with autosuggest
authorChristian Dywan <christian@twotoasts.de>
Tue, 13 Mar 2012 19:03:20 +0000 (20:03 +0100)
committerChristian Dywan <christian@twotoasts.de>
Tue, 13 Mar 2012 19:04:46 +0000 (20:04 +0100)
data/autosuggestcontrol.js

index 85a506ab6954749e97b1061db3ac2030220b05c2..389bfd47b55df45113991ea5746ff8b679d901e7 100644 (file)
@@ -186,10 +186,10 @@ AutoSuggestControl.prototype.init = function () {
     };
 
     //assign onblur event handler (hides suggestions)
-    this.textbox.onblur =
-    this.textbox.onclick = function () {
-        oThis.hideSuggestions();
-    };
+    if (!this.textbox.onblur)
+      this.textbox.onblur = function () { oThis.hideSuggestions(); };
+    if (!this.textbox.onclick)
+      this.textbox.onclick = function () { oThis.hideSuggestions(); };
 
     //create the suggestions dropdown
     this.createDropDown();
@@ -299,7 +299,7 @@ function initSuggestions () {
     if (inputs.length == 0)
         return false;
 
-    for (i=0;i<inputs.length;i++)
+    for (var i=0;i<inputs.length;i++)
     {
         var ename = inputs[i].getAttribute("name");
         var eid = inputs[i].getAttribute("id");