diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-09-07 14:56:27 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-09-07 14:56:27 -0400 |
| commit | a7104749040bc425d1170901c6e7d8d5a8045fb3 (patch) | |
| tree | 336b267593c4fed8afb7fb38b16f5f3cfb4034bf /public/assets/js/lib/views/mail/mailbox.js | |
| parent | 9957952d2761b1d2b216a9310339e28f25df9f6c (diff) | |
list mailboxes
Diffstat (limited to 'public/assets/js/lib/views/mail/mailbox.js')
| -rw-r--r-- | public/assets/js/lib/views/mail/mailbox.js | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/public/assets/js/lib/views/mail/mailbox.js b/public/assets/js/lib/views/mail/mailbox.js index 315a713..ac66c4c 100644 --- a/public/assets/js/lib/views/mail/mailbox.js +++ b/public/assets/js/lib/views/mail/mailbox.js @@ -9,7 +9,7 @@ var MailboxView = View.extend({ initialize: function(){ this.__super__.initialize.call(this) this.template = this.$(".template").html() - this.boxTemplate = this.$(".boxTemplate").html() + this.boxlist = new BoxList () }, load: function(name){ @@ -19,17 +19,10 @@ var MailboxView = View.extend({ }, populate: function(data){ - data.boxes.forEach(this.appendBox.bind(this)) + this.boxlist.load(data.boxes) data.messages.forEach(this.appendMessage.bind(this)) }, - parseBox: function(box){ - var t = this.boxTemplate - .replace(/{{box}}/g, box.name) - .replace(/{{count}}/g, box.count) - return t - }, - parseMessage: function(message){ var datetime = verbose_date(message.date) var id = message.id @@ -46,11 +39,6 @@ var MailboxView = View.extend({ return t }, - appendBox: function(box){ - var $row = $( this.parseBox(box) ) - this.$el.append($row) - }, - appendMessage: function(message){ var $row = $( this.parseMessage(message) ) this.$el.append($row) |
