summaryrefslogtreecommitdiff
path: root/roundcubemail/program/js
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-04-09 19:38:50 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-04-09 19:38:50 +0000
commitf1408450f456b4f1bcb89c480106012f11e01607 (patch)
treecdbaaa0ec6bbf29a8ea4745f8f06781480233103 /roundcubemail/program/js
parentb88d1aaa93235d9757aedc5b353ae612161a66e9 (diff)
- Fix drag&drop with scrolling on IE (#1485786)
git-svn-id: https://svn.roundcube.net/trunk@2382 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js')
-rw-r--r--roundcubemail/program/js/app.js11
-rw-r--r--roundcubemail/program/js/list.js2
2 files changed, 11 insertions, 2 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js
index 51cce5df3..7f60de544 100644
--- a/roundcubemail/program/js/app.js
+++ b/roundcubemail/program/js/app.js
@@ -53,7 +53,6 @@ function rcube_webmail()
this.env.bin_path = './bin/';
this.env.blankpage = 'program/blank.gif';
-
// set environment variable(s)
this.set_env = function(p, value)
{
@@ -1182,6 +1181,9 @@ function rcube_webmail()
this.drag_start = function(list)
{
+ this.initialBodyScrollTop = bw.ie ? 0 : window.pageYOffset;
+ this.initialMailBoxScrollTop = document.getElementById("mailboxlist-container").scrollTop;
+
var model = this.task == 'mail' ? this.env.mailboxes : this.env.address_sources;
this.drag_active = true;
@@ -1213,10 +1215,17 @@ function rcube_webmail()
{
if (this.gui_objects.folderlist && this.env.folder_coords)
{
+ // offsets to compensate for scrolling while dragging a message
+ var boffset = bw.ie ? -document.documentElement.scrollTop : this.initialBodyScrollTop;
+ var moffset = this.initialMailBoxScrollTop-document.getElementById('mailboxlist-container').scrollTop;
+ var toffset = -moffset-boffset;
+
var li, pos, mouse;
mouse = rcube_event.get_mouse_pos(e);
pos = this.env.folderlist_coords;
+ mouse.y += toffset;
+
// if mouse pointer is outside of folderlist
if (mouse.x < pos.x1 || mouse.x >= pos.x2
|| mouse.y < pos.y1 || mouse.y >= pos.y2)
diff --git a/roundcubemail/program/js/list.js b/roundcubemail/program/js/list.js
index 1fe493ca9..7bae7a5f6 100644
--- a/roundcubemail/program/js/list.js
+++ b/roundcubemail/program/js/list.js
@@ -774,7 +774,7 @@ drag_mouse_move: function(e)
if (this.drag_active && this.draglayer)
{
var pos = rcube_event.get_mouse_pos(e);
- this.draglayer.move(pos.x+20, pos.y-5);
+ this.draglayer.move(pos.x+20, bw.ie ? pos.y-5+document.documentElement.scrollTop : pos.y-5);
this.trigger_event('dragmove', e);
}