diff --git a/api/js/egw_action/egw_action.js b/api/js/egw_action/egw_action.js index 65897aec70..befb74a8fd 100644 --- a/api/js/egw_action/egw_action.js +++ b/api/js/egw_action/egw_action.js @@ -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 } } - selObj.setSelected(true); + 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 diff --git a/api/templates/default/etemplate2.css b/api/templates/default/etemplate2.css index 69ceb8320c..0834749066 100644 --- a/api/templates/default/etemplate2.css +++ b/api/templates/default/etemplate2.css @@ -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;