Improve css gradients feature detection

pull/110/head
Thibaut 11 years ago
parent eb1141c7c0
commit 20b1c02a3a

@ -154,7 +154,7 @@
classList: !!document.body.classList classList: !!document.body.classList
insertAdjacentHTML: !!document.body.insertAdjacentHTML insertAdjacentHTML: !!document.body.insertAdjacentHTML
defaultPrevented: document.createEvent('CustomEvent').defaultPrevented is false defaultPrevented: document.createEvent('CustomEvent').defaultPrevented is false
cssGradients: getComputedStyle(document.querySelector('._header')).backgroundImage isnt 'none' cssGradients: supportsCssGradients()
for key, value of features when not value for key, value of features when not value
Raven.captureMessage "unsupported/#{key}" Raven.captureMessage "unsupported/#{key}"
@ -178,4 +178,9 @@
isInvalidLocation: -> isInvalidLocation: ->
@config.env is 'production' and location.host.indexOf(app.config.production_host) isnt 0 @config.env is 'production' and location.host.indexOf(app.config.production_host) isnt 0
supportsCssGradients = ->
el = document.createElement('div')
el.style.cssText = "background-image: -webkit-linear-gradient(top, #000, #fff); background-image: linear-gradient(to top, #000, #fff);"
el.style.backgroundImage.indexOf('gradient') >= 0
$.extend app, Events $.extend app, Events

Loading…
Cancel
Save