Created
April 9, 2012 21:28
-
-
Save billsaysthis/2346669 to your computer and use it in GitHub Desktop.
Backbone with TB2 modal sample View class
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
ZPCommon.Views.SocialSharesView = Backbone.View.extend({ | |
template: 'public/common/socialShares_hb', | |
id: 'socialShares', | |
className: 'buttonBox', | |
initialize: function() { | |
_.bindAll(this, 'emailShare'); | |
}, | |
events: { | |
'click #emailShareBtn': 'emailShare' | |
}, | |
emailShare: function(e) { | |
e.preventDefault(); | |
$('#emailShareModal').modal('show'); | |
} | |
}); |
Bill, I figured it out. Hard to say what I was doing wrong but mainly because I'm still learning how Backbone fires and responds to events in Views. Thanks for chiming in.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shouldn't be, we have very few routes and none have a hash at the start. Also, I would have expected the preventDefault() to block that.