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/handlers/state/columns-transformer.ts

32 lines
1006 B

import {debug_log} from '../../../../helpers/debug_output';
import {States} from '../../../states.service';
import {injectorBridge} from '../../../angular/angular-injector-bridge.functions';
import {WorkPackageTable} from '../../wp-fast-table';
import {WorkPackageResource} from '../../../api/api-v3/hal-resources/work-package-resource.service';
export class ColumnsTransformer {
public states:States;
constructor(public table: WorkPackageTable) {
injectorBridge(this);
this.states.table.columns.observe(null).subscribe(() => {
if (table.rows.length > 0) {
var t0 = performance.now();
// Redraw all visible rows without reloading the table
table.rows.forEach((wpId) => {
let row = table.rowIndex[wpId];
table.refreshRow(row);
});
table.postRender();
var t1 = performance.now();
debug_log("column redraw took " + (t1 - t0) + " milliseconds.");
}
});
}
}
ColumnsTransformer.$inject = ['states'];