Browse files

updated from upstream chosen gem

added chosen-sprite@2x.png
  • Loading branch information...
1 parent 92c8191 commit efc21c5087443fecde85d80c443b7966ef261f95 @asanghi committed Jan 20, 2013
View
2 lib/chosen-rails/source_file.rb
@@ -8,6 +8,7 @@ def fetch
self.destination_root = "vendor/assets"
remote = "https://github.com/harvesthq/chosen"
get "#{remote}/raw/master/chosen/chosen-sprite.png", "images/chosen-sprite.png"
+ get "#{remote}/raw/master/chosen/chosen-sprite@2x.png", "images/chosen-sprite@2x.png"
get "#{remote}/raw/master/chosen/chosen.css", "stylesheets/chosen.css"
get "#{remote}/raw/master/coffee/lib/abstract-chosen.coffee", "javascripts/lib/abstract-chosen.coffee"
get "#{remote}/raw/master/coffee/lib/select-parser.coffee", "javascripts/lib/select-parser.coffee"
@@ -28,6 +29,7 @@ def convert
inside destination_root do
run("sass-convert -F css -T sass stylesheets/chosen.css stylesheets/chosen.css.sass")
gsub_file 'stylesheets/chosen.css.sass', '(chosen-sprite.png)', "('chosen-sprite.png')"
+ gsub_file 'stylesheets/chosen.css.sass', '(chosen-sprite@2x.png)', "('chosen-sprite@2x.png')"
gsub_file 'stylesheets/chosen.css.sass', ' url', ' image-url'
end
end
View
BIN vendor/assets/images/chosen-sprite@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
10 vendor/assets/javascripts/chosen.jquery.coffee
@@ -7,9 +7,17 @@ $ = jQuery
$.fn.extend({
chosen: (options) ->
+ ua = navigator.userAgent.toLowerCase();
+
+ match = /(msie) ([\w.]+)/.exec( ua ) || [];
+
+ browser =
+ name: match[ 1 ] || ""
+ version: match[ 2 ] || "0"
+
# Do no harm and return as soon as possible for unsupported browsers, namely IE6 and IE7
# Continue on if running IE document type but in compatibility mode
- return this if $.browser.msie and ($.browser.version is "6.0" or ($.browser.version is "7.0" and document.documentMode is 7 ))
+ return this if browser.name is "msie" and (browser.version is "6.0" or (browser.version is "7.0" and document.documentMode is 7 ))
this.each((input_field) ->
$this = $ this
$this.data('chosen', new Chosen(this, options)) unless $this.hasClass "chzn-done"

0 comments on commit efc21c5

Please sign in to comment.