Move message selection to an event-based system

Messages are now selected on a MessageList, which triggers a
message_selected event that other parts of the code can listen for.

(imported from commit 1da9e4121425c0ac4461b41b7aea169072e1512b)
This commit is contained in:
Zev Benjamin
2013-02-20 14:49:49 -05:00
parent ed51bd0432
commit 4c9e3a167e
6 changed files with 53 additions and 69 deletions

View File

@@ -41,7 +41,8 @@ MessageList.prototype = {
throw (new Error("Selected message id not in MessageList"));
}
this._selected_id = id;
select_message(rows.get(id, this.table_name), this, opts);
opts = $.extend({then_scroll: false}, opts, {id: id, msg_list: this});
$(document).trigger($.Event('message_selected.zephyr', opts));
},
selected_message: function MessageList_selected_message() {