Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Pulled from upstream using rake update-chosen (fixes #16) #17

Merged
merged 1 commit into from

2 participants

@asanghi

Pull chosen-sprite@2x.png in source_file
added chosen-sprite@2x.png

fixes #16

@tsechingho tsechingho merged commit be2d556 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 20, 2013
  1. @asanghi

    updated from upstream chosen gem

    asanghi authored
    added chosen-sprite@2x.png
This page is out of date. Refresh to see the latest.
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"
Something went wrong with that request. Please try again.