summaryrefslogtreecommitdiff
path: root/program/js/app.js
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-04-27 09:01:15 +0000
committeralecpl <alec@alec.pl>2009-04-27 09:01:15 +0000
commit9f3579b1f8f02eb3f1d506657b36e425954013b4 (patch)
tree5306b554427a80bb14380aba8b63a5b1e18f04bc /program/js/app.js
parent29da6414db77512106250b9832a0b4a0168bd7eb (diff)
- Fix wrong column sort order icons (#1485823)
- set defult sorting of new column to 'ASC'
Diffstat (limited to 'program/js/app.js')
-rw-r--r--program/js/app.js21
1 files changed, 8 insertions, 13 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 6293392cb..6080fba31 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -599,20 +599,15 @@ function rcube_webmail()
// get the type of sorting
var a_sort = props.split('_');
var sort_col = a_sort[0];
- var sort_order = a_sort[1] ? a_sort[1].toUpperCase() : null;
-
- // no sort order specified: toggle
- if (sort_order==null)
- {
- if (this.env.sort_col==sort_col)
- sort_order = this.env.sort_order=='ASC' ? 'DESC' : 'ASC';
- else
- sort_order = this.env.sort_order;
- }
-
- if (this.env.sort_col==sort_col && this.env.sort_order==sort_order)
- break;
+ var sort_order = a_sort[1] ? a_sort[1].toUpperCase() : 'ASC';
+ if (this.env.sort_col==sort_col) {
+ sort_order = this.env.sort_order=='ASC' ? 'DESC' : 'ASC';
+
+ if (this.env.sort_order==sort_order)
+ break;
+ }
+
// set table header class
$('#rcm'+this.env.sort_col).removeClass('sorted'+(this.env.sort_order.toUpperCase()));
$('#rcm'+sort_col).addClass('sorted'+sort_order);