Created
January 9, 2013 14:45
-
-
Save joshuaballoch/4493648 to your computer and use it in GitHub Desktop.
ideas on how to attach page-specific javascript
This file contains 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
javascript: | |
window.app = window.app || {}; | |
app.view = new Ledapei.SomeNameOfAView(); | |
This file contains 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 Ledapei.SomeNameOfAView extends Backbone.View | |
el: "body" | |
events: | |
#declare events as you usually would: | |
"click .something": "method_to_fire" | |
initialize: (opts)-> | |
that = this | |
#do other things in here on initialize | |
method_to_fire: (event)-> | |
$target = $(event.currentTarget); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment