update to latest version of chosen

gh-pages
Patrick Filler 2011-08-16 15:26:37 -04:00
parent ead88bcb00
commit 8ede1f6486
1 changed files with 16 additions and 8 deletions

View File

@ -86,8 +86,8 @@
return this.set_tab_index();
};
Chosen.prototype.register_observers = function() {
this.container.observe("click", __bind(function(evt) {
return this.container_click(evt);
this.container.observe("mousedown", __bind(function(evt) {
return this.container_mousedown(evt);
}, this));
this.container.observe("mouseenter", __bind(function(evt) {
return this.mouse_enter(evt);
@ -95,8 +95,8 @@
this.container.observe("mouseleave", __bind(function(evt) {
return this.mouse_leave(evt);
}, this));
this.search_results.observe("click", __bind(function(evt) {
return this.search_results_click(evt);
this.search_results.observe("mouseup", __bind(function(evt) {
return this.search_results_mouseup(evt);
}, this));
this.search_results.observe("mouseover", __bind(function(evt) {
return this.search_results_mouseover(evt);
@ -129,8 +129,8 @@
}, this));
}
};
Chosen.prototype.container_click = function(evt) {
if (evt && evt.type === "click") {
Chosen.prototype.container_mousedown = function(evt) {
if (evt && evt.type === "mousedown") {
evt.stop();
}
if (!this.pending_destroy_click) {
@ -156,7 +156,7 @@
};
Chosen.prototype.input_focus = function(evt) {
if (!this.active_field) {
return setTimeout(this.container_click.bind(this), 50);
return setTimeout(this.container_mousedown.bind(this), 50);
}
};
Chosen.prototype.input_blur = function(evt) {
@ -340,7 +340,7 @@
return this.search_field.removeClassName("default");
}
};
Chosen.prototype.search_results_click = function(evt) {
Chosen.prototype.search_results_mouseup = function(evt) {
var target;
target = evt.target.hasClassName("active-result") ? evt.target : evt.target.up(".active-result");
if (target) {
@ -693,8 +693,16 @@
return Chosen;
})();
root.Chosen = Chosen;
if (Prototype.Browser.IE) {
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
Prototype.BrowserFeatures['Version'] = new Number(RegExp.$1);
}
}
document.observe('dom:loaded', function(evt) {
var select, selects, _i, _len, _results;
if (Prototype.Browser.IE && (Prototype.BrowserFeatures['Version'] === 6 || Prototype.BrowserFeatures['Version'] === 7)) {
return;
}
selects = $$(".chzn-select");
_results = [];
for (_i = 0, _len = selects.length; _i < _len; _i++) {