| | |
| | | | | |
| | | | This file is part of the Roundcube Webmail client | |
| | | | Copyright (C) 2006-2009, The Roundcube Dev Team | |
| | | | Licensed under the GNU GPL | |
| | | | | |
| | | | Licensed under the GNU General Public License version 3 or | |
| | | | any later version with exceptions for skins & plugins. | |
| | | | See the README file for a full license statement. | |
| | | | | |
| | | +-----------------------------------------------------------------------+ |
| | | | Authors: Thomas Bruederli <roundcube@gmail.com> | |
| | |
| | | +-----------------------------------------------------------------------+ |
| | | | Requires: common.js | |
| | | +-----------------------------------------------------------------------+ |
| | | |
| | | $Id$ |
| | | */ |
| | | |
| | | |
| | |
| | | */ |
| | | remove_row: function(uid, sel_next) |
| | | { |
| | | if (this.rows[uid].obj) |
| | | this.rows[uid].obj.style.display = 'none'; |
| | | var obj = this.rows[uid] ? this.rows[uid].obj : null; |
| | | |
| | | if (!obj) |
| | | return; |
| | | |
| | | obj.style.display = 'none'; |
| | | |
| | | if (sel_next) |
| | | this.select_next(); |
| | |
| | | for (n in this.selection) { |
| | | id = this.selection[n]; |
| | | if (this.rows[id] && this.rows[id].obj) { |
| | | $(this.rows[id].obj).removeClass('selected').addClass('unfocused'); |
| | | $(this.rows[id].obj).removeClass('selected focused').addClass('unfocused'); |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.in_selection_before = false; |
| | | |
| | | // row was double clicked |
| | | if (this.rows && dblclicked && this.in_selection(id)) |
| | | if (this.rows && dblclicked && this.in_selection(id)) { |
| | | this.triggerEvent('dblclick'); |
| | | now = 0; |
| | | } |
| | | else |
| | | this.triggerEvent('click'); |
| | | |
| | |
| | | collapse: function(row) |
| | | { |
| | | row.expanded = false; |
| | | this.triggerEvent('expandcollapse', { uid:row.uid, expanded:row.expanded }); |
| | | this.triggerEvent('expandcollapse', { uid:row.uid, expanded:row.expanded, obj:row.obj }); |
| | | var depth = row.depth; |
| | | var new_row = row ? row.obj.nextSibling : null; |
| | | var r; |
| | |
| | | $(new_row).css('display', 'none'); |
| | | if (r.expanded) { |
| | | r.expanded = false; |
| | | this.triggerEvent('expandcollapse', { uid:r.uid, expanded:r.expanded }); |
| | | this.triggerEvent('expandcollapse', { uid:r.uid, expanded:r.expanded, obj:new_row }); |
| | | } |
| | | } |
| | | new_row = new_row.nextSibling; |
| | |
| | | depth = row.depth; |
| | | new_row = row.obj.nextSibling; |
| | | this.update_expando(row.uid, true); |
| | | this.triggerEvent('expandcollapse', { uid:row.uid, expanded:row.expanded }); |
| | | this.triggerEvent('expandcollapse', { uid:row.uid, expanded:row.expanded, obj:row.obj }); |
| | | } |
| | | else { |
| | | var tbody = this.list.tBodies[0]; |
| | |
| | | last_expanded_parent_depth = p.depth; |
| | | $(new_row).css('display', ''); |
| | | r.expanded = true; |
| | | this.triggerEvent('expandcollapse', { uid:r.uid, expanded:r.expanded }); |
| | | this.triggerEvent('expandcollapse', { uid:r.uid, expanded:r.expanded, obj:new_row }); |
| | | } |
| | | } |
| | | else |
| | |
| | | depth = row.depth; |
| | | new_row = row.obj.nextSibling; |
| | | this.update_expando(row.uid); |
| | | this.triggerEvent('expandcollapse', { uid:row.uid, expanded:row.expanded }); |
| | | this.triggerEvent('expandcollapse', { uid:row.uid, expanded:row.expanded, obj:row.obj }); |
| | | |
| | | // don't collapse sub-root tree in multiexpand mode |
| | | if (depth && this.multiexpand) |
| | |
| | | if (r.has_children && r.expanded) { |
| | | r.expanded = false; |
| | | this.update_expando(r.uid, false); |
| | | this.triggerEvent('expandcollapse', { uid:r.uid, expanded:r.expanded }); |
| | | this.triggerEvent('expandcollapse', { uid:r.uid, expanded:r.expanded, obj:new_row }); |
| | | } |
| | | } |
| | | } |
| | |
| | | depth = row.depth; |
| | | new_row = row.obj.nextSibling; |
| | | this.update_expando(row.uid, true); |
| | | this.triggerEvent('expandcollapse', { uid:row.uid, expanded:row.expanded }); |
| | | this.triggerEvent('expandcollapse', { uid:row.uid, expanded:row.expanded, obj:row.obj }); |
| | | } |
| | | else { |
| | | new_row = this.list.tBodies[0].firstChild; |
| | |
| | | if (r.has_children && !r.expanded) { |
| | | r.expanded = true; |
| | | this.update_expando(r.uid, true); |
| | | this.triggerEvent('expandcollapse', { uid:r.uid, expanded:r.expanded }); |
| | | this.triggerEvent('expandcollapse', { uid:r.uid, expanded:r.expanded, obj:new_row }); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | for (i=0, len=rows.length-1; i<len; i++) |
| | | if (rows[i].id && String(rows[i].id).match(/^rcmrow([a-z0-9\-_=\+\/]+)/i) && this.rows[RegExp.$1] != null) |
| | | return RegExp.$1; |
| | | return RegExp.$1; |
| | | } |
| | | |
| | | return null; |
| | |
| | | */ |
| | | key_press: function(e) |
| | | { |
| | | if (this.focused != true) |
| | | var target = e.target || {}; |
| | | if (this.focused != true || target.nodeName == 'INPUT' || target.nodeName == 'TEXTAREA' || target.nodeName == 'SELECT') |
| | | return true; |
| | | |
| | | var keyCode = rcube_event.get_keycode(e), |
| | |
| | | */ |
| | | key_down: function(e) |
| | | { |
| | | var target = e.target || {}; |
| | | if (this.focused != true || target.nodeName == 'INPUT' || target.nodeName == 'TEXTAREA' || target.nodeName == 'SELECT') |
| | | return true; |
| | | |
| | | switch (rcube_event.get_keycode(e)) { |
| | | case 27: |
| | | if (this.drag_active) |
| | | return this.drag_mouse_up(e); |
| | | return this.drag_mouse_up(e); |
| | | if (this.col_drag_active) { |
| | | this.selected_column = null; |
| | | return this.column_drag_mouse_up(e); |
| | | return this.column_drag_mouse_up(e); |
| | | } |
| | | |
| | | case 40: |