This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clone():Goal { | |
return new Goal({ | |
title: this.title + ' (clone)', | |
tasks: this.tasks.clone(), | |
archived: this.archived | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class EditorComponent implements OnInit, OnChanges, DoCheck { | |
ngDoCheck() { | |
this.reBuildTasks(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class GoalComponent implements OnChanges, DoCheck { | |
ngDoCheck() { | |
this.reComputeTasks(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class GoalComponent implements OnChanges { | |
.... | |
... | |
... | |
ngOnChanges() { | |
this.reComputeTasks(); | |
} | |
private reComputeTasks() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class EditorComponent implements OnInit, OnChanges { | |
ngOnInit() { | |
this.reBuildTasks(); | |
} | |
ngOnChanges() { | |
this.reBuildTasks(); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="goals" sd-layout="row" sd-layout-wrap dnd-sortable-container | |
[dropZones]="['boxers-zone']" [sortableData]="_listGoals"> | |
<goal [goalItem]="goalItem" *ngFor="let goalItem of _listGoals; let i = index" | |
dnd-sortable [sortableIndex]="i" (click)="editGoal($event, goalItem)"> | |
</goal> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Input ('title') title: string; | |
@Input ('goalItem') goalItem: Goal; | |
private completedTasks:TaskCollection; | |
private inCompletedTasks:TaskCollection; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="goal-body"> | |
<!-- Pending Tasks --> | |
<div class="task" *ngFor="let taskItem of inCompletedTasks; let i = index" sd-layout="row"> | |
<md-checkbox class="task-checkbox" color="warn" [checked]="taskItem.completed" | |
(change)="itemClicked($event, taskItem)"></md-checkbox> | |
<span class="description">{{taskItem.title | sdtruncate : 60 }}</span> | |
</div> | |
<!-- Completed Tasks --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Progress bar --> | |
<md-progress-bar value="{{goalItem?.progress}}" color="warn"> | |
</md-progress-bar> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
triggerHideOverlayEvent() { | |
var editorLayout = document.getElementById('goalEditor'); | |
editorLayout.style.opacity = '0'; | |
editorLayout.style.zIndex = '-100'; | |
setTimeout(function() { | |
editorLayout.hidden = true; | |
}, 600); | |
} |