History

Improve css gradients feature detection

Thibaut committed 12 years ago

Commit 20b1c021 parent eb1141c1 file · +6 −1Browse files

Unified · Split

assets/javascripts/app/app.coffee+6−1
@@ -154,7 +154,7 @@ · 153 unmodified lines
154 classList: !!document.body.classList154 classList: !!document.body.classList
155 insertAdjacentHTML: !!document.body.insertAdjacentHTML155 insertAdjacentHTML: !!document.body.insertAdjacentHTML
156 defaultPrevented: document.createEvent('CustomEvent').defaultPrevented is false156 defaultPrevented: document.createEvent('CustomEvent').defaultPrevented is false
157 cssGradients: getComputedStyle(document.querySelector('._header')).backgroundImage isnt 'none'157 cssGradients: supportsCssGradients()
158 158
159 for key, value of features when not value159 for key, value of features when not value
160 Raven.captureMessage "unsupported/#{key}"160 Raven.captureMessage "unsupported/#{key}"
@@ -178,4 +178,9 @@ · 17 unmodified lines
178 isInvalidLocation: ->178 isInvalidLocation: ->
179 @config.env is 'production' and location.host.indexOf(app.config.production_host) isnt 0179 @config.env is 'production' and location.host.indexOf(app.config.production_host) isnt 0
180 180
181supportsCssGradients = ->
182 el = document.createElement('div')
183 el.style.cssText = "background-image: -webkit-linear-gradient(top, #000, #fff); background-image: linear-gradient(to top, #000, #fff);"
184 el.style.backgroundImage.indexOf('gradient') >= 0
185
181$.extend app, Events186$.extend app, Events