diff --git a/assets/javascripts/app/app.coffee b/assets/javascripts/app/app.coffee index 350d21b1..c4c40583 100644 --- a/assets/javascripts/app/app.coffee +++ b/assets/javascripts/app/app.coffee @@ -154,7 +154,7 @@ classList: !!document.body.classList insertAdjacentHTML: !!document.body.insertAdjacentHTML 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 Raven.captureMessage "unsupported/#{key}" @@ -178,4 +178,9 @@ isInvalidLocation: -> @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