OpenProject is the leading open source project management software.
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.
openproject/frontend/app/components/wp-fast-table/builders/context-link-icon-builder.ts

36 lines
1.0 KiB

import {$injectFields} from '../../angular/angular-injector-bridge.functions';
import {opIconElement} from "../../../helpers/op-icon-builder";
import {wpCellTdClassName} from "./cell-builder";
export const contextMenuTdClassName = 'wp-table--context-menu-column';
export const contextMenuLinkClassName = 'wp-table-context-menu-link';
export class ContextLinkIconBuilder {
// Injections
public I18n: op.I18n;
public text: any;
constructor() {
$injectFields(this, 'I18n');
this.text = {
button: this.I18n.t('js.button_open_details')
};
}
public build(): HTMLElement {
// Append details button
let td = document.createElement('td');
td.classList.add(wpCellTdClassName, contextMenuTdClassName, 'hide-when-print');
// Enter the context menu arrow
let detailsLink = document.createElement('a');
detailsLink.classList.add(contextMenuLinkClassName);
detailsLink.appendChild(opIconElement('icon', 'icon-show-more-horizontal'));
td.appendChild(detailsLink);
return td;
}
}