Created
March 21, 2012 21:28
-
-
Save drale2k/2153016 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Etaxi.Routers.Base extends Backbone.Router | |
routes: | |
'register' : 'registerDevice' | |
'a' : 'b' | |
b: -> | |
alert "a" | |
initialize: -> | |
@registerDevice() unless localStorage.device_id? | |
@getGeolocation() | |
registerDevice: -> | |
@collection = new Etaxi.Collections.Devices() | |
@collection.fetch() | |
view = new Etaxi.Views.RegisterDevice(collection: @collection) | |
$('#wrapper').append(view.render().el) | |
getGeolocation: -> | |
navigator.geolocation.getCurrentPosition (position) -> | |
lat = position.coords.latitude | |
lng = position.coords.longitude | |
#$('#apphead').tap -> | |
# alert 'Position: ' + lat + " ," + lng |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment