Files
habitica/website/client-old/js/directives/task.directive.js
Keith Holliday 68ad3e2d4a Task notes modals (#8521)
* Merged in develop

* Show task notes modal on click

* Began adding tests

* Removed extra characters

* Fixed lingering popup

* Added markdown

* Fixed line endings
2017-03-27 09:10:21 -06:00

42 lines
953 B
JavaScript

'use strict';
(function(){
angular
.module('habitrpg')
.directive('task', task);
task.$inject = [
'Shared',
'$modal',
];
function task(Shared, $modal) {
return {
restrict: 'E',
templateUrl: 'templates/task.html',
scope: true,
link: function($scope, element, attrs) {
$scope.getClasses = function (task, user, list, main) {
return Shared.taskClasses(task, user.filters, user.preferences.dayStart, user.lastCron, list.showCompleted, main);
}
$scope.showNoteDetails = function (task) {
task.popoverOpen = false;
$modal.open({
templateUrl: 'modals/task-extra-notes.html',
controller: function ($scope, task) {
$scope.task = task;
},
resolve: {
task: function() {
return task;
}
}
})
};
}
}
}
}());