Created
December 5, 2012 13:02
-
-
Save patrickjholloway/4215344 to your computer and use it in GitHub Desktop.
Backbone view
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 Workshop.Views.FontsIndex extends Backbone.View | |
el: '#content_wrapper' | |
initialize: -> | |
this.current_user = new Workshop.Models.Currentuser | |
this.current_user.fetch() | |
this.fonts = new Workshop.Collections.Fonts | |
this.fonts.fetch() | |
events: | |
'mouseenter span': 'whiteIcon' | |
'mouseleave span': 'blackIcon' | |
'click span': 'addHideFont' | |
whiteIcon: (e) => | |
$(e.target).children('.icon-plus').addClass('icon-white') | |
blackIcon: (e) => | |
$(e.target).children('.icon-plus').removeClass('icon-white') | |
addHideFont: (e) => | |
fontName = $(e.target).text() | |
fontName = "string" | |
#this.current_user.fonts.push(this.fonts.where({name: fontName})) | |
console.log(this.fonts.where({name: fontName})) | |
console.log(fontName.charAt(0)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment