couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From garrensmith <...@git.apache.org>
Subject [GitHub] couchdb pull request: 2125 sort tasks refactor
Date Wed, 09 Apr 2014 07:53:21 GMT
Github user garrensmith commented on a diff in the pull request:

    https://github.com/apache/couchdb/pull/203#discussion_r11425761
  
    --- Diff: src/fauxton/app/addons/activetasks/views.js ---
    @@ -28,23 +28,105 @@ function (app, FauxtonAPI, activetasks) {
     
       Views.Events = _.extend(Events, Backbone.Events);
     
    +  Views.View = FauxtonAPI.View.extend({
    +    tagName: "table",
    +
    +    className: "table table-bordered table-striped active-tasks",
    +
    +    template: "addons/activetasks/templates/table",
    +
    +    events: {
    +      "click th": "sortByType"
    +    },
    +
    +    filter: "all",
    +
    +    initialize: function (options) {
    +      ActiveTasks.events.on("tasks:filter", this.filterAndRender, this);
    +      this.collection.bind("reset", _.bind(this.render, this));
    --- End diff --
    
    With newer versions of Backbone its better to do. `this.listenTo(this.collection, "reset",
this.render)`. The event will then be garbage collected when the view is removed. It also
automatically binds the `this` context. http://backbonejs.org/#Events-listenTo


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message