Require wpEditForm in wp-list-view-button

pull/4338/head
Oliver Günther 9 years ago
parent c7d9be477d
commit ee6ce82d39
  1. 9
      frontend/app/components/wp-buttons/wp-list-view-button/wp-list-view-button.directive.ts

@ -28,10 +28,11 @@
import {wpButtonsModule} from '../../../angular-modules';
import {WorkPackageNavigationButtonController, wpButtonDirective} from '../wp-buttons.module';
import {WorkPackageEditFormController} from "../../wp-edit/wp-edit-form.directive";
export class WorkPackageListViewButtonController extends WorkPackageNavigationButtonController {
public projectIdentifier:number;
public editAll:any;
public formCtrl:WorkPackageEditFormController;
public accessKey:number = 8;
public activeState:string = 'work-packages.list';
@ -50,7 +51,7 @@ export class WorkPackageListViewButtonController extends WorkPackageNavigationBu
}
public get disabled() {
return !!this.editAll.state;
return this.formCtrl.inEditMode;
}
public performAction() {
@ -73,6 +74,10 @@ function wpListViewButton():ng.IDirective {
projectIdentifier: '=',
editAll: '='
},
require: '^wpEditForm',
link: function(scope, element, attrs, wpEditForm) {
scope.vm.formCtrl = wpEditForm;
},
controller: WorkPackageListViewButtonController,
});

Loading…
Cancel
Save