Browse Source

Fix exception in $.scrollParent

Thibaut Courouble 8 years ago
parent
commit
0240932198
1 changed files with 1 additions and 1 deletions
  1. 1 1
      assets/javascripts/lib/util.coffee

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

@@ -158,7 +158,7 @@ $.offset = (el, container = document.body) ->
   left: left
 
 $.scrollParent = (el) ->
-  while el.nodeType is 1 and el = el.parentNode
+  while (el = el.parentNode) and el.nodeType is 1
     break if el.scrollTop > 0
     break if getComputedStyle(el)?.overflowY in ['auto', 'scroll']
   el