mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:50 +01:00
Etemplate - add ability to toggle row selection with spacebar
This commit is contained in:
parent
310182cc85
commit
07773ded32
@ -1604,11 +1604,11 @@ egwActionObject.prototype.handleKeyPress = function(_keyCode, _shift, _ctrl, _al
|
||||
|
||||
if (selObj != null)
|
||||
{
|
||||
if (!_shift)
|
||||
if (!_shift && !(this.parent && this.parent.data && this.parent.data.keyboard_select))
|
||||
{
|
||||
this.setAllSelected(false);
|
||||
}
|
||||
else
|
||||
else if (!(this.parent && this.parent.data && this.parent.data.keyboard_select))
|
||||
{
|
||||
var objs = focused.traversePath(selObj);
|
||||
for (var i = 0; i < objs.length; i++)
|
||||
@ -1617,7 +1617,10 @@ egwActionObject.prototype.handleKeyPress = function(_keyCode, _shift, _ctrl, _al
|
||||
}
|
||||
}
|
||||
|
||||
if(!(this.parent.data && this.parent.data.keyboard_select))
|
||||
{
|
||||
selObj.setSelected(true);
|
||||
}
|
||||
selObj.setFocused(true);
|
||||
|
||||
// Tell the aoi of the object to make it visible
|
||||
@ -1630,6 +1633,29 @@ egwActionObject.prototype.handleKeyPress = function(_keyCode, _shift, _ctrl, _al
|
||||
|
||||
break;
|
||||
|
||||
// Space bar toggles selected for current row
|
||||
case EGW_KEY_SPACE:
|
||||
if (this.children.length <= 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
// Mark that we're selecting by keyboard, or arrows will reset selection
|
||||
if(!this.parent.data)
|
||||
{
|
||||
this.parent.data = {};
|
||||
}
|
||||
this.parent.data.keyboard_select = true;
|
||||
|
||||
// Get the focused object
|
||||
var focused = this.getFocusedObject();
|
||||
|
||||
focused.setSelected(!focused.getSelected());
|
||||
|
||||
// Tell the aoi of the object to make it visible
|
||||
focused.makeVisible();
|
||||
return true;
|
||||
|
||||
break;
|
||||
// Handle CTRL-A to select all elements in the current container
|
||||
case EGW_KEY_A:
|
||||
if (_ctrl && !_shift && !_alt)
|
||||
@ -1797,6 +1823,10 @@ egwActionObject.prototype.setAllSelected = function(_selected, _informParent)
|
||||
{
|
||||
this.parent.updateSelectedChildren(this, _selected);
|
||||
}
|
||||
if(this.parent.data && this.parent.data.keyboard_select)
|
||||
{
|
||||
this.parent.data.keyboard_select = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Update the children if the should be selected or if they should be
|
||||
|
@ -1646,6 +1646,8 @@ div.message.floating {
|
||||
/* background-color: silver;*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Allow space for category color indicators, preserving column calculations */
|
||||
.et2_nextmatch .egwGridView_outer thead tr > th:first-child {
|
||||
border-left: 6px solid transparent;
|
||||
@ -1901,7 +1903,12 @@ ul[id$='favorites_popup_state'] span.filter_value {
|
||||
margin-right: -11px;
|
||||
}
|
||||
/* End of hierarchy */
|
||||
|
||||
.et2_nextmatch .egwGridView_grid tr.focused {
|
||||
background: rgba(153, 204, 255, 0.4);
|
||||
}
|
||||
.et2_nextmatch .egwGridView_grid tr.focused.selected {
|
||||
background: rgba(153, 204, 255, 0.7);
|
||||
}
|
||||
/* Nextmatch tiled view */
|
||||
.et2_nextmatch .egwGridView_grid tr.tile {
|
||||
display: inline-block;
|
||||
|
Loading…
Reference in New Issue
Block a user