Skip to content

Commit

Permalink
Merge changes from harvesthq#149
Browse files Browse the repository at this point in the history
  • Loading branch information
pfiller committed Aug 16, 2011
1 parent 528d77b commit 57fcc57
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 7 deletions.
5 changes: 0 additions & 5 deletions chosen/chosen.css
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
3 changes: 3 additions & 0 deletions chosen/chosen.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion chosen/chosen.jquery.min.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions chosen/chosen.proto.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
2 changes: 1 addition & 1 deletion chosen/chosen.proto.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions coffee/chosen.jquery.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
9 changes: 9 additions & 0 deletions coffee/chosen.proto.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 57fcc57

Please sign in to comment.