Skip to content

Commit

Permalink
Merge pull request #16 from brewster1134/2.0.3_event_animation_separa…
Browse files Browse the repository at this point in the history
…tion

2.0.4
  • Loading branch information
brewster1134 authored Jun 29, 2016
2 parents 1ea9f3b + 87a9248 commit 99d9ee9
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
.sass-cache
.tmp
vendor
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#### CHANGE LOG

###### 2.0.4
* separated tiler events from transition

###### 2.0.3
* single tile support

Expand Down
2 changes: 1 addition & 1 deletion Newfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sources:
default: ~/Code/ruby/new-tasks
name: Tiler
version: 2.0.2
version: 2.0.4
tasks:
changelog:
git:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ npm install
bower install
```

Do **NOT** modify any `.js` files! Modify the coffee files in the `src` directory. Guard will watch for changes and compile them to the `lib` directory.
Do **NOT** modify any `.js` files! Modify the coffee files in the `src` directory. Testem will watch for changes and compile them to the `lib` directory.

### Compiling & Testing
Run `testem`
12 changes: 8 additions & 4 deletions lib/tiler.js

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

4 changes: 2 additions & 2 deletions spec/tiler_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ describe 'Tiler', ->
$tiler.tiler()
$tiler.tiler 'goTo', 1, false

it 'should not fire events', ->
expect(currentTileViewportSpy).to.not.be.called
it 'should fire events', ->
expect(currentTileViewportSpy).to.be.called

it 'should not update the tile classes', ->
# tile 1
Expand Down
14 changes: 8 additions & 6 deletions src/tiler.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# * tiler
# * https://github.com/brewster1134/tiler
# *
# * @version 2.0.2
# * @version 2.0.4
# * @author Ryan Brewster
# * Copyright (c) 2014
# * Licensed under the MIT license.
Expand Down Expand Up @@ -47,13 +47,15 @@
goTo: (tileValue, animation) ->
# Get new active & previous tiles
$enteringTile = @_getTile tileValue
return unless $enteringTile.length
$exitingTile = @$currentActiveTile

# Return if we are already on that tile
return if !$enteringTile.length || $enteringTile[0] == @$currentActiveTile[0]

# Update css classes for animation
@_transitionCss $enteringTile, $exitingTile, animation
if $enteringTile[0] == @$currentActiveTile[0]
# Just finalize if we are already on the tile
@_finalizeNewTiles $enteringTile, $exitingTile
else
# Update css classes for animation
@_transitionCss $enteringTile, $exitingTile, animation

return $enteringTile

Expand Down

0 comments on commit 99d9ee9

Please sign in to comment.