浏览代码

Fix exception in $.scrollParent

Thibaut Courouble 9 年之前
父节点
当前提交
55de422d55
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      assets/javascripts/lib/util.coffee

+ 1 - 1
assets/javascripts/lib/util.coffee

@@ -157,7 +157,7 @@ $.offset = (el, container = document.body) ->
 $.scrollParent = (el) ->
 $.scrollParent = (el) ->
   while el = el.parentElement
   while el = el.parentElement
     break if el.scrollTop > 0
     break if el.scrollTop > 0
-    break if getComputedStyle(el).overflowY in ['auto', 'scroll']
+    break if getComputedStyle(el)?.overflowY in ['auto', 'scroll']
   el
   el
 
 
 $.scrollTo = (el, parent, position = 'center', options = {}) ->
 $.scrollTo = (el, parent, position = 'center', options = {}) ->