| | |
| | | |
| | | |
| | | /** |
| | | * Invert selection |
| | | */ |
| | | invert_selection: function() |
| | | { |
| | | if (!this.rows || !this.rows.length) |
| | | return false; |
| | | |
| | | // remember old selection |
| | | var select_before = this.selection.join(','); |
| | | |
| | | for (var n in this.rows) |
| | | this.highlight_row(n, true); |
| | | |
| | | // trigger event if selection changed |
| | | if (this.selection.join(',') != select_before) |
| | | this.triggerEvent('select'); |
| | | |
| | | this.focus(); |
| | | |
| | | return true; |
| | | }, |
| | | |
| | | |
| | | /** |
| | | * Unselect selected row(s) |
| | | */ |
| | | clear_selection: function(id) |
| | |
| | | |
| | | var keyCode = rcube_event.get_keycode(e); |
| | | var mod_key = rcube_event.get_modifier(e); |
| | | |
| | | switch (keyCode) |
| | | { |
| | | case 40: |
| | |
| | | { |
| | | switch (rcube_event.get_keycode(e)) |
| | | { |
| | | case 27: |
| | | if (this.drag_active) |
| | | this.drag_mouse_up(e); |
| | | case 40: |
| | | case 38: |
| | | case 63233: |
| | |
| | | |
| | | if (!this.draglayer) |
| | | this.draglayer = $('<div>').attr('id', 'rcmdraglayer').css({ position:'absolute', display:'none', 'z-index':2000 }).appendTo(document.body); |
| | | |
| | | |
| | | // get subjects of selectedd messages |
| | | var names = ''; |
| | | var c, i, node, subject, obj; |
| | |
| | | if (((node = obj.childNodes[i].firstChild) && (node.nodeType==3 || node.nodeName=='A')) && |
| | | (this.subject_col < 0 || (this.subject_col >= 0 && this.subject_col == c))) |
| | | { |
| | | if (n == 0) |
| | | this.drag_start_pos = $(node).offset(); |
| | | |
| | | if (n == 0) { |
| | | if (node.nodeType == 3) |
| | | this.drag_start_pos = $(obj.childNodes[i]).offset(); |
| | | else |
| | | this.drag_start_pos = $(node).offset(); |
| | | } |
| | | subject = node.nodeType==3 ? node.data : node.innerHTML; |
| | | // remove leading spaces |
| | | subject = subject.replace(/^\s+/i, ''); |
| | |
| | | { |
| | | var pos = rcube_event.get_mouse_pos(e); |
| | | this.draglayer.css({ left:(pos.x+20)+'px', top:(pos.y-5 + (bw.ie ? document.documentElement.scrollTop : 0))+'px' }); |
| | | this.triggerEvent('dragmove', e); |
| | | this.triggerEvent('dragmove', e?e:window.event); |
| | | } |
| | | |
| | | this.drag_start = false; |