diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-01-02 19:57:21 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-01-02 20:00:52 -0500 |
commit | 71c31ecf731ff9f6f1d7107ae03397ec98c9f61f (patch) | |
tree | e4e882053aefdbe01534d3263c2789f182375607 /app/assets | |
parent | e5800d65de66aded6178252c4ae5025633eccc5e (diff) | |
download | gitlab-ce-71c31ecf731ff9f6f1d7107ae03397ec98c9f61f.tar.gz |
Ensure the sweep always starts from the left
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/logo.js.coffee | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/app/assets/javascripts/logo.js.coffee b/app/assets/javascripts/logo.js.coffee index 8cd9f865e37..47135a6c5eb 100644 --- a/app/assets/javascripts/logo.js.coffee +++ b/app/assets/javascripts/logo.js.coffee @@ -1,14 +1,14 @@ NProgress.configure(showSpinner: false) defaultClass = 'tanuki-shape' -highlightClass = 'highlight' pieces = [ - 'path#tanuki-right-cheek', - 'path#tanuki-right-eye, path#tanuki-right-ear', - 'path#tanuki-nose', - 'path#tanuki-left-eye, path#tanuki-left-ear', 'path#tanuki-left-cheek', + 'path#tanuki-left-eye, path#tanuki-left-ear', + 'path#tanuki-nose', + 'path#tanuki-right-eye, path#tanuki-right-ear', + 'path#tanuki-right-cheek', ] +firstPiece = pieces[0] timeout = null clearHighlights = -> @@ -16,18 +16,19 @@ clearHighlights = -> start = -> clearHighlights() + pieces.reverse() unless pieces[0] == firstPiece work(0) stop = -> window.clearTimeout(timeout) clearHighlights() -work = (pieceIndex) => +work = (pieceIndex) -> # jQuery's addClass won't work on an SVG. Who knew! $piece = $(pieces[pieceIndex]) - $piece.attr('class', "#{defaultClass} #{highlightClass}") + $piece.attr('class', "#{defaultClass} highlight") - timeout = setTimeout(=> + timeout = setTimeout(-> $piece.attr('class', defaultClass) # If we hit the last piece, reset the index and then reverse the array to |