Skip to content

Commit 222a46d

Browse files
committed
Fixed critical recall mode bug
1 parent 117a20f commit 222a46d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

gui/frontend/src/mindtagger/mindtagger.coffee

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,18 @@ angular.module 'mindbenderApp.mindtagger', [
341341
# A controller that sets item and tag to those of the cursor
342342
.controller 'MindtaggerTaskCursorFollowCtrl', ($scope) ->
343343
$scope.$watch 'MindtaggerTask.cursor.index', (cursorIndex) ->
344-
cursor = $scope.MindtaggerTask.cursor
344+
cursor =
345+
if cursorIndex?
346+
$scope.MindtaggerTask.cursor
347+
else
348+
# XXX phantom item/tag for undefined cursors
349+
item: {}
350+
tag: {}
351+
# This can prevent other directives from breaking the $scope,
352+
# e.g., mindtaggerValueSetTag directive configured to work with
353+
# cursor item/tag attributes can create a bogus item/tag in its
354+
# scope shadowing this directive's item/tag if no phantom
355+
# objects are provided here.
345356
$scope.item = cursor.item
346357
$scope.tag = cursor.tag
347358

0 commit comments

Comments
 (0)