mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-16 06:23:03 +00:00
118223: Stop space from scrolling down page
This commit is contained in:
@@ -138,6 +138,7 @@ export class ItemBitstreamsComponent extends AbstractItemUpdateComponent impleme
|
||||
// Otherwise we might clear the selection when a different action was intended, e.g. clicking a button or selecting
|
||||
// a different bitstream.
|
||||
if (event.target instanceof Element && event.target.tagName === 'BODY') {
|
||||
event.preventDefault();
|
||||
this.itemBitstreamsService.clearSelection();
|
||||
}
|
||||
}
|
||||
|
@@ -82,7 +82,7 @@
|
||||
<th class="bitstream-name row-element {{ columnSizes.columns[0].buildClasses() }}"
|
||||
scope="row" id="{{ entry.nameStripped }}" headers="{{ bundleName }} name">
|
||||
<div class="drag-handle text-muted float-left p-1 mr-2" tabindex="0" cdkDragHandle
|
||||
(keyup.enter)="select(entry)" (keyup.space)="select(entry)" (click)="select(entry)">
|
||||
(keydown.enter)="select($event, entry)" (keydown.space)="select($event, entry)" (click)="select($event, entry)">
|
||||
<i class="fas fa-grip-vertical fa-fw"
|
||||
[title]="'item.edit.bitstreams.edit.buttons.drag' | translate"></i>
|
||||
</div>
|
||||
|
@@ -423,9 +423,17 @@ export class ItemEditBitstreamBundleComponent implements OnInit, OnDestroy {
|
||||
* Handles a select action for the provided bitstream entry.
|
||||
* If the selected bitstream is currently selected, the selection is cleared.
|
||||
* If no, or a different bitstream, is selected, the provided bitstream becomes the selected bitstream.
|
||||
* @param bitstream
|
||||
* @param event The event that triggered the select action
|
||||
* @param bitstream The bitstream that is the target of the select action
|
||||
*/
|
||||
select(bitstream: BitstreamTableEntry) {
|
||||
select(event: UIEvent, bitstream: BitstreamTableEntry) {
|
||||
event.preventDefault();
|
||||
|
||||
if (event instanceof KeyboardEvent && event.repeat) {
|
||||
// Don't handle hold events, otherwise it would change rapidly between being selected and unselected
|
||||
return;
|
||||
}
|
||||
|
||||
const selectedBitstream = this.itemBitstreamsService.getSelectedBitstream();
|
||||
|
||||
if (hasValue(selectedBitstream) && selectedBitstream.bitstream === bitstream) {
|
||||
|
Reference in New Issue
Block a user