From e48f8945b32ab5b67f1cdeb53a37d3d196e31e4d Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 20 May 2016 05:19:01 -0400
Subject: [PATCH] Fix bug where message list columns could be in wrong order after column drag-n-drop and list sorting
---
program/js/list.js | 35 ++++++++++++++++++-----------------
CHANGELOG | 2 ++
2 files changed, 20 insertions(+), 17 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index 7420e7c..1e0aff7 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,9 +1,11 @@
CHANGELOG Roundcube Webmail
===========================
+
- Fix message list multi-select/deselect issue (#5219)
- Fix bug where contact search menu fields where always unchecked in Larry skin
- Fix XSS issue in href attribute on area tag (#5240)
+- Fix bug where message list columns could be in wrong order after column drag-n-drop and list sorting
RELEASE 1.1.5
-------------
diff --git a/program/js/list.js b/program/js/list.js
index 99fd48f..9b0bd9a 100644
--- a/program/js/list.js
+++ b/program/js/list.js
@@ -1688,32 +1688,33 @@
this.col_draglayer = null;
}
- if (this.col_drag_active)
- this.focus();
- this.col_drag_active = false;
-
rcube_event.remove_listener({event:'mousemove', object:this, method:'column_drag_mouse_move'});
rcube_event.remove_listener({event:'mouseup', object:this, method:'column_drag_mouse_up'});
+
// remove temp divs
this.del_dragfix();
- if (this.selected_column !== null && this.cols && this.cols.length) {
- var i, cpos = 0, pos = rcube_event.get_mouse_pos(e);
+ if (this.col_drag_active) {
+ this.col_drag_active = false;
+ this.focus();
+ this.triggerEvent('column_dragend', e);
- // find destination position
- for (i=0; i<this.cols.length; i++) {
- if (pos.x >= this.cols[i]/2 + this.list_pos + cpos)
- cpos += this.cols[i];
- else
- break;
- }
+ if (this.selected_column !== null && this.cols && this.cols.length) {
+ var i, cpos = 0, pos = rcube_event.get_mouse_pos(e);
- if (i != this.selected_column && i != this.selected_column+1) {
- this.column_replace(this.selected_column, i);
+ // find destination position
+ for (i=0; i<this.cols.length; i++) {
+ if (pos.x >= this.cols[i]/2 + this.list_pos + cpos)
+ cpos += this.cols[i];
+ else
+ break;
+ }
+
+ if (i != this.selected_column && i != this.selected_column+1) {
+ this.column_replace(this.selected_column, i);
+ }
}
}
-
- this.triggerEvent('column_dragend', e);
return rcube_event.cancel(e);
},
--
Gitblit v1.9.1