summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-10-24 11:36:48 +0200
committerAleksander Machniak <alec@alec.pl>2012-10-24 11:36:48 +0200
commitf0affa6cc29ac05c1b73f47efe2c8751e3ca4c87 (patch)
tree6101e7f1d969f9c1e3d44501be5b983a2c5a9220 /program/js
parent1e7aa75d18e34b0733d49a3af689be0f3d73b83c (diff)
- Fix handling dont_override with message_sort_col and message_sort_order settings (#1488760)
Diffstat (limited to 'program/js')
-rw-r--r--program/js/app.js19
1 files changed, 8 insertions, 11 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 06eb9295c..8296400ba 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -594,12 +594,11 @@ function rcube_webmail()
break;
case 'sort':
- var sort_order, sort_col = props;
+ var sort_order = this.env.sort_order,
+ sort_col = !this.env.disabled_sort_col ? props : this.env.sort_col;
- if (this.env.sort_col==sort_col)
- sort_order = this.env.sort_order=='ASC' ? 'DESC' : 'ASC';
- else
- sort_order = 'ASC';
+ if (!this.env.disabled_sort_order)
+ sort_order = this.env.sort_col == sort_col && sort_order == 'ASC' ? 'DESC' : 'ASC';
// set table header and update env
this.set_list_sorting(sort_col, sort_order);
@@ -5733,13 +5732,11 @@ function rcube_webmail()
col = this.env.coltypes[n];
if ((cell = thead.rows[0].cells[n]) && (col == 'from' || col == 'to' || col == 'fromto')) {
cell.id = 'rcm'+col;
+ $('span,a', cell).text(this.get_label(col == 'fromto' ? smart_col : col));
// if we have links for sorting, it's a bit more complicated...
- if (cell.firstChild && cell.firstChild.tagName.toLowerCase()=='a') {
- cell = cell.firstChild;
- cell.onclick = function(){ return rcmail.command('sort', this.__col, this); };
- cell.__col = col;
- }
- cell.innerHTML = this.get_label(col == 'fromto' ? smart_col : col);
+ $('a', cell).click(function(){
+ return rcmail.command('sort', this.id.replace(/^rcm/, ''), this);
+ });
}
}
}