|
|
|
@ -39,6 +39,7 @@ import {FocusHelperService} from 'core-app/modules/common/focus/focus-helper'; |
|
|
|
|
import {WorkPackageTable} from 'core-components/wp-fast-table/wp-fast-table'; |
|
|
|
|
import {WorkPackageEditingPortalService} from "core-app/modules/fields/edit/editing-portal/wp-editing-portal-service"; |
|
|
|
|
import {IFieldSchema} from "core-app/modules/fields/field.base"; |
|
|
|
|
import {editModeClassName} from "core-app/modules/fields/edit/edit-field.component"; |
|
|
|
|
|
|
|
|
|
export class TableRowEditContext implements WorkPackageEditContext { |
|
|
|
|
|
|
|
|
@ -77,6 +78,7 @@ export class TableRowEditContext implements WorkPackageEditContext { |
|
|
|
|
// Forcibly set the width since the edit field may otherwise
|
|
|
|
|
// be given more width. Thereby preserve a minimum width of 120.
|
|
|
|
|
const td = this.findCell(fieldName); |
|
|
|
|
td.addClass(editModeClassName); |
|
|
|
|
var width = td.css('width'); |
|
|
|
|
width = parseInt(width) > 150 ? width : '150px'; |
|
|
|
|
td.css('max-width', width); |
|
|
|
@ -95,11 +97,13 @@ export class TableRowEditContext implements WorkPackageEditContext { |
|
|
|
|
|
|
|
|
|
public reset(workPackage:WorkPackageResource, fieldName:string, focus?:boolean) { |
|
|
|
|
const cell = this.findContainer(fieldName); |
|
|
|
|
const td = this.findCell(fieldName); |
|
|
|
|
|
|
|
|
|
if (cell.length) { |
|
|
|
|
this.findCell(fieldName).css('width', ''); |
|
|
|
|
this.findCell(fieldName).css('max-width', ''); |
|
|
|
|
this.cellBuilder.refresh(cell[0], workPackage, fieldName); |
|
|
|
|
td.removeClass(editModeClassName); |
|
|
|
|
|
|
|
|
|
if (focus) { |
|
|
|
|
this.FocusHelper.focusElement(cell); |
|
|
|
|