| | |
| | | this.drag_active = false; |
| | | this.env.last_folder_target = null; |
| | | |
| | | if (this.folder_auto_timer) { |
| | | window.clearTimeout(this.folder_auto_timer); |
| | | this.folder_auto_timer = null; |
| | | this.folder_auto_expand = null; |
| | | } |
| | | |
| | | // over the folders |
| | | if (this.gui_objects.folderlist && this.env.folder_coords) { |
| | | for (var k in this.env.folder_coords) { |
| | |
| | | var moffset = this.initialListScrollTop-this.gui_objects.folderlist.parentNode.scrollTop; |
| | | var toffset = -moffset-boffset; |
| | | |
| | | var li, pos, mouse; |
| | | var li, div, pos, mouse; |
| | | mouse = rcube_event.get_mouse_pos(e); |
| | | pos = this.env.folderlist_coords; |
| | | mouse.y += toffset; |
| | |
| | | pos = this.env.folder_coords[k]; |
| | | if (mouse.x >= pos.x1 && mouse.x < pos.x2 && mouse.y >= pos.y1 && mouse.y < pos.y2 |
| | | && this.check_droptarget(k)) { |
| | | $(this.get_folder_li(k)).addClass('droptarget'); |
| | | |
| | | li = this.get_folder_li(k); |
| | | div = $(li.getElementsByTagName("div")[0]); |
| | | |
| | | // if the folder is collapsed, expand it after 1sec and restart the drag & drop process. |
| | | if (div.hasClass('collapsed')) { |
| | | if (this.folder_auto_timer) |
| | | window.clearTimeout(this.folder_auto_timer); |
| | | |
| | | this.folder_auto_expand = k; |
| | | this.folder_auto_timer = window.setTimeout(function() { |
| | | rcmail.command("collapse-folder", rcmail.folder_auto_expand); |
| | | rcmail.drag_start(null); |
| | | }, 1000); |
| | | } |
| | | |
| | | if (!div.hasClass('collapsed') && this.folder_auto_timer) { |
| | | window.clearTimeout(this.folder_auto_timer); |
| | | this.folder_auto_timer = null; |
| | | this.folder_auto_expand = null; |
| | | } |
| | | |
| | | $(li).addClass('droptarget'); |
| | | this.env.last_folder_target = k; |
| | | this.env.folder_coords[k].on = 1; |
| | | } |