Cancel bubbling of mousedown events
parent
45415b58b9
commit
8f2a400174
|
@ -178,7 +178,7 @@ SimpleAutocomplete.prototype.makeItem = function(name, value, checked)
|
||||||
d.appendChild(document.createTextNode(name));
|
d.appendChild(document.createTextNode(name));
|
||||||
var self = this;
|
var self = this;
|
||||||
addListener(d, 'mouseover', function() { return self.onItemMouseOver(this); });
|
addListener(d, 'mouseover', function() { return self.onItemMouseOver(this); });
|
||||||
addListener(d, 'mousedown', function() { return self.onItemClick(this); });
|
addListener(d, 'mousedown', function(ev) { return self.onItemClick(ev, this); });
|
||||||
this.items.push([name, value, checked]);
|
this.items.push([name, value, checked]);
|
||||||
return d;
|
return d;
|
||||||
};
|
};
|
||||||
|
@ -323,8 +323,9 @@ SimpleAutocomplete.prototype.onItemMouseOver = function(elm)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle item clicks
|
// Handle item clicks
|
||||||
SimpleAutocomplete.prototype.onItemClick = function(elm)
|
SimpleAutocomplete.prototype.onItemClick = function(ev, elm)
|
||||||
{
|
{
|
||||||
|
stopEvent(ev||window.event, true, false);
|
||||||
this.selectItem(parseInt(elm.id.substr(this.id.length+6)));
|
this.selectItem(parseInt(elm.id.substr(this.id.length+6)));
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue