Merge changes from #149

abstract-chosen
Patrick Filler 2011-08-16 14:52:18 -04:00
parent 528d77bc04
commit 57fcc576c3
7 changed files with 24 additions and 7 deletions

View File

@ -1,9 +1,4 @@
/* @group Base */
select.chzn-select {
visibility: hidden;
height: 28px !important;
min-height: 28px !important;
}
.chzn-container {
font-size: 13px;
position: relative;

View File

@ -17,6 +17,9 @@
$ = jQuery;
$.fn.extend({
chosen: function(data, options) {
if ($.browser === "msie" && ($.browser.version === "6.0" || $.browser.version === "7.0")) {
return this;
}
return $(this).each(function(input_field) {
if (!($(this)).hasClass("chzn-done")) {
return new Chosen(this, data, options);

File diff suppressed because one or more lines are too long

View File

@ -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++) {

File diff suppressed because one or more lines are too long

View File

@ -7,6 +7,8 @@ $ = jQuery
$.fn.extend({
chosen: (data, options) ->
# Do no harm and return as soon as possible for unsupported browsers, namely IE6 and IE7
return this if $.browser is "msie" and ($.browser.version is "6.0" or $.browser.version is "7.0")
$(this).each((input_field) ->
new Chosen(this, data, options) unless ($ this).hasClass "chzn-done"
)

View File

@ -574,7 +574,16 @@ class Chosen
root.Chosen = Chosen
# Prototype does not support version numbers so we add it ourselves
if Prototype.Browser.IE
if /MSIE (\d+\.\d+);/.test(navigator.userAgent)
Prototype.BrowserFeatures['Version'] = new Number(RegExp.$1);
document.observe 'dom:loaded', (evt) ->
# Do no harm and return as soon as possible for unsupported browsers, namely IE6 and IE7
return if Prototype.Browser.IE and (Prototype.BrowserFeatures['Version'] is 6 or Prototype.BrowserFeatures['Version'] is 7)
selects = $$(".chzn-select")
new Chosen select for select in selects