diff --git a/public/js/directives/directives.js b/public/js/directives/directives.js index 62b8bbafc6..baef14ccdb 100644 --- a/public/js/directives/directives.js +++ b/public/js/directives/directives.js @@ -129,3 +129,34 @@ habitrpg.directive('hrpgSortTags', ['User', function(User) { }); } }]); + +habitrpg + .directive( 'popoverHtmlPopup', ['$sce', function($sce) { + return { + restrict: 'EA', + replace: true, + scope: { title: '@', content: '@', placement: '@', animation: '&', isOpen: '&' }, + link: function(scope, element, attrs) { + scope.$watch('content', function(value, oldValue) { + scope.unsafeContent = $sce.trustAsHtml(scope.content); + }); + }, + templateUrl: 'template/popover/popover-html.html' + }; + }]) + .directive( 'popoverHtml', [ '$compile', '$timeout', '$parse', '$window', '$tooltip', + function ( $compile, $timeout, $parse, $window, $tooltip ) { + return $tooltip( 'popoverHtml', 'popover', 'click' ); + } + ]) + .run(["$templateCache", function($templateCache) { + $templateCache.put("template/popover/popover-html.html", + "
\n" + + "
\n" + + "\n" + + "
\n" + + "

\n" + + "
\n" + + "
\n" + + "
\n"); + }]); \ No newline at end of file diff --git a/views/shared/tasks/task.jade b/views/shared/tasks/task.jade index 4b38fac7d4..28487fb2ce 100644 --- a/views/shared/tasks/task.jade +++ b/views/shared/tasks/task.jade @@ -1,4 +1,4 @@ -li(bindonce='list', bo-id='"task-"+task.id', ng-repeat='task in obj[list.type+"s"]', class='task {{Shared.taskClasses(task, user.filters, user.preferences.dayStart, user.lastCron, list.showCompleted, main)}}', ng-click='spell && castEnd(task, "task", $event)', ng-class='{"cast-target":spell}', popover-trigger='mouseenter', popover-placement='top', popover='{{task.notes}}') +li(bindonce='list', bo-id='"task-"+task.id', ng-repeat='task in obj[list.type+"s"]', class='task {{Shared.taskClasses(task, user.filters, user.preferences.dayStart, user.lastCron, list.showCompleted, main)}}', ng-click='spell && castEnd(task, "task", $event)', ng-class='{"cast-target":spell}', popover-trigger='mouseenter', data-popover-html="{{task.notes | markdown}}", data-popover-placement="top") // right-hand side control buttons .task-meta-controls @@ -147,7 +147,7 @@ li(bindonce='list', bo-id='"task-"+task.id', ng-repeat='task in obj[list.type+"s input.option-content(type='text', ng-model='task.text', required, ng-disabled='task.challenge.id') label.option-title=env.t('extraNotes') - textarea.option-content(rows='3', ng-model='task.notes') + textarea.option-content(rows='3', ng-model='task.notes', ng-model-options="{debounce: 1000}") // if Habit, plus/minus command options fieldset.option-group(ng-if='task.type=="habit" && !task.challenge.id')