File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
gui/frontend/src/mindtagger Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -341,7 +341,18 @@ angular.module 'mindbenderApp.mindtagger', [
341
341
# A controller that sets item and tag to those of the cursor
342
342
.controller ' MindtaggerTaskCursorFollowCtrl' , ($scope ) ->
343
343
$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.
345
356
$scope .item = cursor .item
346
357
$scope .tag = cursor .tag
347
358
You can’t perform that action at this time.
0 commit comments