diff options
author | johndoh <roundcube@tehinterweb.co.uk> | 2020-06-28 11:58:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-28 11:58:13 +0300 |
commit | 279ae66120884262c419528b72e7aa4b908e0514 (patch) | |
tree | 9d1192ef20ce10e876c05fec6e1367c1be3b92f3 /program/js/app.js | |
parent | 13a066b24fa3761a9e08a80685d8b76d0f544bce (diff) |
Move all message list entry generation to client side (#7287)
Always return cols required for widescreen message list and control layout only on JS side
Diffstat (limited to 'program/js/app.js')
-rw-r--r-- | program/js/app.js | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/program/js/app.js b/program/js/app.js index c27555d8b..8751c0453 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -2163,7 +2163,7 @@ function rcube_webmail() }; // create a table row in the message list - this.add_message_row = function(uid, cols, flags, attop) + this.add_message_row = function(uid, cols, flags, attop, layout = this.env.layout) { if (!this.gui_objects.messagelist || !this.message_list) return false; @@ -2211,7 +2211,14 @@ function rcube_webmail() + (flags.deleted ? ' deleted' : '') + (flags.flagged ? ' flagged' : '') + (message.selected ? ' selected' : ''), - row = { cols:[], style:{}, id:'rcmrow'+msg_id, uid:uid }; + row = { cols:[], style:{}, id:'rcmrow'+msg_id, uid:uid }, + listcols = layout == 'widescreen' ? this.env.listcols_widescreen : this.env.listcols; + + // widescreen layout does not have a separate status column + if (layout == 'widescreen') + this.env.status_col = null; + else if ((n = $.inArray('status', this.env.listcols)) >= 0) + this.env.status_col = n; // message status icons css_class = 'msgicon'; @@ -2290,8 +2297,8 @@ function rcube_webmail() } // add each submitted col - for (n in this.env.listcols) { - c = this.env.listcols[n]; + for (n in listcols) { + c = listcols[n]; col = {className: String(c).toLowerCase(), events:{}}; if (this.env.coltypes[c] && this.env.coltypes[c].hidden) { @@ -2356,7 +2363,7 @@ function rcube_webmail() row.cols.push(col); } - if (this.env.layout == 'widescreen') + if (layout == 'widescreen') row = this.widescreen_message_row(row, uid, message); list.insert_row(row, attop); @@ -8332,7 +8339,7 @@ function rcube_webmail() { var list = this.message_list, thead = list ? list.thead : null, - repl, cell, col, n, len, tr; + repl, cell, col, c, n, len, tr; this.env.listcols = listcols; @@ -8345,7 +8352,8 @@ function rcube_webmail() thead.innerHTML = ''; tr = document.createElement('tr'); - for (c=0, len=repl.length; c < len; c++) { + for (n in this.env.listcols) { + c = this.env.listcols[n]; cell = document.createElement('th'); cell.innerHTML = repl[c].html || ''; if (repl[c].id) cell.id = repl[c].id; |