Guest User

Untitled

a guest
Jul 17th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. var DrinksView = Backbone.View.extend({
  2. el: '#menu',
  3. events: {
  4. 'click .drink-item': function(evt) {
  5. console.log("*** CLICKED TO GET DRINK ***")
  6. evt.preventDefault();
  7. evt.stopPropagation();
  8. var url = "";
  9. url += $(evt.currentTarget).attr('href') + "/" + new Date().getTime().toString();
  10.  
  11. if(this.isFavorites)
  12. url += "?isFavorite=true&favoriteId=" + $(evt.currentTarget).data().drinkId;
  13.  
  14. app.router.navigate(url, true);
  15. }
  16. },
  17. close : function(){
  18. this.remove(); // removes view from dom
  19. this.unbind(); // unbinds all the events associated with the view
  20. },
Add Comment
Please, Sign In to add comment