Skip to content

Commit 99d9ee9

Browse files
authored
Merge pull request #16 from brewster1134/2.0.3_event_animation_separation
2.0.4
2 parents 1ea9f3b + 87a9248 commit 99d9ee9

File tree

7 files changed

+24
-14
lines changed

7 files changed

+24
-14
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.DS_Store
12
.sass-cache
23
.tmp
34
vendor

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#### CHANGE LOG
22

3+
###### 2.0.4
4+
* separated tiler events from transition
5+
36
###### 2.0.3
47
* single tile support
58

Newfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
sources:
33
default: ~/Code/ruby/new-tasks
44
name: Tiler
5-
version: 2.0.2
5+
version: 2.0.4
66
tasks:
77
changelog:
88
git:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ npm install
208208
bower install
209209
```
210210

211-
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.
211+
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.
212212

213213
### Compiling & Testing
214214
Run `testem`

lib/tiler.js

Lines changed: 8 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/tiler_spec.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ describe 'Tiler', ->
7777
$tiler.tiler()
7878
$tiler.tiler 'goTo', 1, false
7979

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

8383
it 'should not update the tile classes', ->
8484
# tile 1

src/tiler.coffee

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# * tiler
33
# * https://github.com/brewster1134/tiler
44
# *
5-
# * @version 2.0.2
5+
# * @version 2.0.4
66
# * @author Ryan Brewster
77
# * Copyright (c) 2014
88
# * Licensed under the MIT license.
@@ -47,13 +47,15 @@
4747
goTo: (tileValue, animation) ->
4848
# Get new active & previous tiles
4949
$enteringTile = @_getTile tileValue
50+
return unless $enteringTile.length
5051
$exitingTile = @$currentActiveTile
5152

52-
# Return if we are already on that tile
53-
return if !$enteringTile.length || $enteringTile[0] == @$currentActiveTile[0]
54-
55-
# Update css classes for animation
56-
@_transitionCss $enteringTile, $exitingTile, animation
53+
if $enteringTile[0] == @$currentActiveTile[0]
54+
# Just finalize if we are already on the tile
55+
@_finalizeNewTiles $enteringTile, $exitingTile
56+
else
57+
# Update css classes for animation
58+
@_transitionCss $enteringTile, $exitingTile, animation
5759

5860
return $enteringTile
5961

0 commit comments

Comments
 (0)