define(['jquery', 'backbone', 'underscore', 'favourites/models/Favourite', 'favourites/collections/Favourites'],
    function($, Backbone, _, Favourite, Favourites) {
        var FavouriteButtonView = Backbone.View.extend({
            initialize: function() {
                _.bindAll(this);
                this.favourites = new Favourites();
                this.favourites.fetch();
                this.updateButton();
                window.addEventListener("hashchange", this.updateButton, false);
            },

            events: {'click': 'toggleFavourite'},

            toggleFavourite: function(e) {
                e.preventDefault();
                var fav = this.favourites.getCurrentPage();
                if (fav) {
                    this.removeFavourite(fav);
                } else {
                    this.addFavourite();
                }
                console.log(this.favourites.toJSON());
            },
            addFavourite: function() {
                var fragment = Backbone.history.fragment;
                this.favourites.create({fragment: fragment});
                this.$el.addClass('favourited');
            },
            removeFavourite: function(favourite) {
                favourite.destroy();
                this.$el.removeClass('favourited');
            },
            updateButton: function(favourite) {
                if (this.favourites.getCurrentPage()) {
                    this.$el.addClass('favourited');
                } else {
                    this.$el.removeClass('favourited');
                }
            }
        });
        return FavouriteButtonView;
    }
);

@@ -413,24 +413,99 @@
 teButton();%0A
+                this.favourites.on(%22remove add%22, this.updateButton, this);%0A
             
@@ -1170,57 +1170,8 @@
 %7D);%0A
-                this.$el.addClass('favourited');%0A
     
@@ -1273,60 +1273,8 @@
 ();%0A
-                this.$el.removeClass('favourited');%0A
     

Apply classes through events