Skip to content

Commit

Permalink
do not mess up the style attribute when WOW is disabled on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
attilaolah committed Sep 24, 2014
1 parent 82f1996 commit 8319652
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 32 deletions.
42 changes: 22 additions & 20 deletions dist/wow.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/wow.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 12 additions & 10 deletions src/wow.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,18 @@ class @WOW
@doSync(@element) if MutationObserver.notSupported

doSync: (element) ->
unless @stopped
element ?= @element
return unless element.nodeType is 1
element = element.parentNode or element
for box in element.querySelectorAll(".#{@config.boxClass}")
unless box in @all
element ?= @element
return unless element.nodeType is 1
element = element.parentNode or element
for box in element.querySelectorAll(".#{@config.boxClass}")
unless box in @all
@boxes.push box
@all.push box
if @stopped or @disabled()
@resetStyle()
else
@applyStyle(box, true)
@boxes.push box
@all.push box
@scrolled = true
@scrolled = true

# show box element
show: (box) ->
Expand All @@ -165,7 +167,7 @@ class @WOW
)()

resetStyle: ->
box.setAttribute('style', 'visibility: visible;') for box in @boxes
box.style.visibility = 'visible' for box in @boxes

customStyle: (box, hidden, duration, delay, iteration) ->
@cacheAnimationName(box) if hidden
Expand Down

0 comments on commit 8319652

Please sign in to comment.