Making sure that we have a .path() in HashNavigation

This commit is contained in:
Rob Harrington
2015-01-21 16:59:32 +11:00
parent 76acbb6159
commit 0791cc3c2a

View File

@@ -1,9 +1,14 @@
Darkswarm.factory 'HashNavigation', ($location) ->
new class HashNavigation
hash: null
hash: null
constructor: ->
# Make sure we have a path as hashes
# dont seem to work so well without them
$location.path("") if !$location.path()
active: (hash)->
$location.hash() == hash
$location.hash() == hash
navigate: (hash)->
@hash = hash