| | |
| | | this.column_fixed = null; |
| | | this.last_selected = 0; |
| | | this.shift_start = 0; |
| | | this.in_selection_before = false; |
| | | this.focused = false; |
| | | this.drag_mouse_start = null; |
| | | this.dblclick_time = 500; // default value on MS Windows is 500 |
| | |
| | | drag_row: function(e, id) |
| | | { |
| | | // don't do anything (another action processed before) |
| | | var evtarget = rcube_event.get_target(e), |
| | | tagname = evtarget.tagName.toLowerCase(); |
| | | |
| | | if (evtarget && (tagname == 'input' || tagname == 'img' || (tagname != 'a' && evtarget.onclick))) |
| | | if (!this.is_event_target(e)) |
| | | return true; |
| | | |
| | | // accept right-clicks |
| | | if (rcube_event.get_button(e) == 2) |
| | | return true; |
| | | |
| | | this.in_selection_before = e && e.istouch || this.in_selection(id) ? id : false; |
| | | |
| | | // selects currently unselected row |
| | | if (!this.in_selection_before) { |
| | | if (e && e.istouch || this.in_selection(id)) { |
| | | var mod_key = rcube_event.get_modifier(e); |
| | | this.select_row(id, mod_key, false); |
| | | } |
| | |
| | | */ |
| | | click_row: function(e, id) |
| | | { |
| | | var now = new Date().getTime(), |
| | | mod_key = rcube_event.get_modifier(e), |
| | | evtarget = rcube_event.get_target(e), |
| | | tagname = evtarget.tagName.toLowerCase(); |
| | | |
| | | if ((evtarget && (tagname == 'input' || tagname == 'img'))) |
| | | // don't do anything (another action processed before) |
| | | if (!this.is_event_target(e)) |
| | | return true; |
| | | |
| | | var dblclicked = now - this.rows[id].clicked < this.dblclick_time; |
| | | var now = new Date().getTime(), |
| | | dblclicked = now - this.rows[id].clicked < this.dblclick_time; |
| | | |
| | | // selects/unselects currently selected row |
| | | if (!this.drag_active && this.in_selection_before == id && !dblclicked) |
| | | this.select_row(id, mod_key, true); |
| | | // selects (or unselects currently selected) row |
| | | if (!this.drag_active && !dblclicked) |
| | | this.select_row(id, rcube_event.get_modifier(e), true); |
| | | |
| | | this.drag_start = false; |
| | | this.in_selection_before = false; |
| | | |
| | | // row was double clicked |
| | | if (this.rowcount && dblclicked && this.in_selection(id)) { |
| | |
| | | }, |
| | | |
| | | |
| | | /** |
| | | * Check target of the current event |
| | | */ |
| | | is_event_target: function(e) |
| | | { |
| | | var target = rcube_event.get_target(e), |
| | | tagname = target.tagName.toLowerCase(); |
| | | |
| | | return !(target && (tagname == 'input' || tagname == 'img' || (tagname != 'a' && target.onclick))); |
| | | }, |
| | | |
| | | |
| | | /* |
| | | * Returns thread root ID for specified row ID |
| | | */ |