Browse Source

Fixed javascript exception.

Martin Edenhofer 9 years ago
parent
commit
46a7227959

+ 1 - 1
app/assets/javascripts/app/lib/app_post/utils.coffee

@@ -594,7 +594,7 @@ class App.Utils
     num
 
   @icon: (name, className = '') ->
-    path = if svgPolyfill then '' else 'assets/images/icons.svg'
+    path = if window.svgPolyfill then '' else 'assets/images/icons.svg'
     "<svg class=\"icon icon-#{name} #{className}\"><use xlink:href=\"#{path}#icon-#{name}\" /></svg>"
 
   @getScrollBarWidth: ->

+ 1 - 1
app/views/init/index.html.erb

@@ -9,7 +9,7 @@
     - Edge 12
     - IE 9-11
   */
-  var svgPolyfill = /\bEdge\/12\b|\bTrident\/[567]\b|\bVersion\/7.0 Safari\b/.test(navigator.userAgent) || (navigator.userAgent.match(/AppleWebKit\/(\d+)/) || [])[1] < 537;
+  window.svgPolyfill = /\bEdge\/12\b|\bTrident\/[567]\b|\bVersion\/7.0 Safari\b/.test(navigator.userAgent) || (navigator.userAgent.match(/AppleWebKit\/(\d+)/) || [])[1] < 537;
 
   (function (doc) {
     if(!svgPolyfill)