2017-12-20 05:33:33 -06:00
|
|
|
import { coreModule } from 'app/core/core';
|
2017-10-24 13:13:34 -05:00
|
|
|
|
|
|
|
export class RowOptionsCtrl {
|
|
|
|
row: any;
|
|
|
|
source: any;
|
|
|
|
dismiss: any;
|
|
|
|
onUpdated: any;
|
2017-12-14 07:27:47 -06:00
|
|
|
showDelete: boolean;
|
2017-10-24 13:13:34 -05:00
|
|
|
|
|
|
|
/** @ngInject */
|
|
|
|
constructor() {
|
|
|
|
this.source = this.row;
|
|
|
|
this.row = this.row.getSaveModel();
|
|
|
|
}
|
|
|
|
|
|
|
|
update() {
|
|
|
|
this.source.title = this.row.title;
|
|
|
|
this.source.repeat = this.row.repeat;
|
|
|
|
this.onUpdated();
|
|
|
|
this.dismiss();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export function rowOptionsDirective() {
|
|
|
|
return {
|
2017-12-20 05:33:33 -06:00
|
|
|
restrict: 'E',
|
|
|
|
templateUrl: 'public/app/features/dashboard/partials/row_options.html',
|
2017-10-24 13:13:34 -05:00
|
|
|
controller: RowOptionsCtrl,
|
|
|
|
bindToController: true,
|
2017-12-20 05:33:33 -06:00
|
|
|
controllerAs: 'ctrl',
|
2017-10-24 13:13:34 -05:00
|
|
|
scope: {
|
2017-12-20 05:33:33 -06:00
|
|
|
row: '=',
|
|
|
|
dismiss: '&',
|
|
|
|
onUpdated: '&',
|
|
|
|
},
|
2017-10-24 13:13:34 -05:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-12-20 05:33:33 -06:00
|
|
|
coreModule.directive('rowOptions', rowOptionsDirective);
|