             t.find(".salvus-task-viewer-not-done").hide()
         if @current_task? and task.task_id == @current_task.task_id
             @set_current_task(task)
+        t.data('task',task)
         @display_last_edited(task)
         @display_title(task)
 

                    continue
            if not skip
                @render_task(task)
        if not @current_task and @task_list.tasks.length > 0
            @set_current_task(@task_list.tasks[0])
        @elt_task_list.sortable()

    render_task: (task) =>
        if not @showing_done and task.done
            return # nothing to do
        t = task_template.clone()
        @elt_task_list.append(t)
        task.element = t
        t.click () => @set_current_task(task)
        t.find(".salvus-task-title").click () => @edit_title(task)

            position     : opts.position
            cb           : opts.cb

    sort_task_list: () =>
        # TODO: define f in terms of various sort crition based on UI
        f = (task1, task2) =>
            if task1.position < task2.position
                return -1
            else if  task1.position > task2.position
                return 1
            else
                return 0
        @task_list.tasks.sort(f)

    render_task_list: () =>
        search = []
        for x in @element.find(".salvus-tasks-search").val().toLowerCase().split()
            x = $.trim(x)
            if x.length > 0
                search.push(x)
        if search.length == 0
            @element.find(".salvus-tasks-search-describe").hide()
        else
            @element.find(".salvus-tasks-search-describe").show().find("span").text(search.join(' '))

        @elt_task_list.empty()
        @sort_task_list()
        first_task = undefined
        for task in @task_list.tasks
            if not @showing_done and task.done
                continue
            skip = false
            t = task.title.toLowerCase()
            for s in search
