kanbanworkflowstimelinescrumrubyroadmapproject-planningproject-managementopenprojectangularissue-trackerifcgantt-chartganttbug-trackerboardsbcf
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.2 KiB
43 lines
1.2 KiB
8 years ago
|
import {injectorBridge} from "../../../angular/angular-injector-bridge.functions";
|
||
|
import {WorkPackageTable} from "../../wp-fast-table";
|
||
7 years ago
|
import {tableRowClassName} from "../../builders/rows/single-row-builder";
|
||
8 years ago
|
import {ContextMenuService} from "../../../context-menus/context-menu.service";
|
||
|
import {keyCodes} from "../../../common/keyCodes.enum";
|
||
7 years ago
|
import {ContextMenuHandler} from "./context-menu-handler";
|
||
8 years ago
|
|
||
7 years ago
|
export class ContextMenuKeyboardHandler extends ContextMenuHandler {
|
||
|
constructor(table:WorkPackageTable) {
|
||
|
super(table);
|
||
8 years ago
|
}
|
||
|
|
||
|
public get EVENT() {
|
||
|
return 'keydown.table.contextmenu';
|
||
|
}
|
||
|
|
||
|
public get SELECTOR() {
|
||
7 years ago
|
return this.rowSelector;
|
||
8 years ago
|
}
|
||
|
|
||
7 years ago
|
public handleEvent(table:WorkPackageTable, evt:JQueryEventObject):boolean {
|
||
8 years ago
|
let target = jQuery(evt.target);
|
||
|
|
||
|
if (!(evt.keyCode === keyCodes.F10 && evt.shiftKey && evt.altKey)) {
|
||
8 years ago
|
return true;
|
||
8 years ago
|
}
|
||
|
|
||
|
evt.preventDefault();
|
||
|
evt.stopPropagation();
|
||
|
|
||
|
// Locate the row from event
|
||
7 years ago
|
const element = target.closest(this.SELECTOR);
|
||
|
const wpId = element.data('workPackageId');
|
||
8 years ago
|
|
||
|
// Set position args to open at element
|
||
|
let position = { of: target };
|
||
|
|
||
7 years ago
|
super.openContextMenu(evt, wpId, position);
|
||
|
|
||
8 years ago
|
return false;
|
||
|
}
|
||
|
}
|