示例#1
0
文件: todo.js 项目: atchai/todowhat
    removeTodo: function() {
        var todoTags = this.model.get('tags');

        // Decrease count/remove model for each tag of the todo (for guests)
        this.model.get('tags').forEach(function(tag) {
            GuestTags.removeTag(tag);
        });

        // Destroy the model tags removed automatically on the backend.
        this.model.destroy();

        // Fetch tags from server so count on view is updated.
        Tags.fetch({reset: true});
        this.render();

        this.$el.slideUp({duration: "slow", easing: "easeInOutBack"});
        Backbone.eventBus.trigger('todoRemoved');
    },
示例#2
0
文件: todo.js 项目: atchai/todowhat
 toggleDone: function() {
     var done = this.model.get('done');
     this.model.save({'done': !done});
     Backbone.eventBus.trigger('statusChanged');
 },
示例#3
0
文件: router.js 项目: atchai/todowhat
 error: function() {
    Backbone.eventBus.trigger('guestMode');
 }
示例#4
0
文件: router.js 项目: atchai/todowhat
 success: function() {
    Backbone.eventBus.trigger('userMode');
 },
示例#5
0
文件: router.js 项目: atchai/todowhat
 change: function() {
     Backbone.eventBus.trigger('routeChanged');
 },
示例#6
0
文件: router.js 项目: atchai/todowhat
 filterTag: function() {
     Backbone.eventBus.trigger('filterTag');
 },
示例#7
0
文件: router.js 项目: atchai/todowhat
 filterNotDone: function() {
     Backbone.eventBus.trigger('filterNotDone');
 },
示例#8
0
文件: router.js 项目: atchai/todowhat
 filterAll: function() {
     Backbone.eventBus.trigger('filterAll');
 },