Skip to content

Commit

Permalink
AppController listens to 'beforeAnnotationCreated'
Browse files Browse the repository at this point in the history
By doing that it catches newly created annotations and clear the current
selection/search result for the newly created card to be visible.

Fix #1979
  • Loading branch information
gergely-ujvari committed Mar 23, 2015
1 parent 393f082 commit 3b962a0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions h/static/scripts/controllers.coffee
Expand Up @@ -20,13 +20,15 @@ class AnnotationUIController

class AppController
this.$inject = [
'$controller', '$document', '$location', '$route', '$scope', '$window',
'$controller', '$document', '$location', '$rootScope', '$route', '$scope',
'$window',
'auth', 'drafts', 'identity',
'permissions', 'streamer', 'annotationUI',
'annotationMapper', 'threading'
]
constructor: (
$controller, $document, $location, $route, $scope, $window,
$controller, $document, $location, $rootScope, $route, $scope,
$window,
auth, drafts, identity,
permissions, streamer, annotationUI,
annotationMapper, threading
Expand Down Expand Up @@ -103,6 +105,9 @@ class AppController
# Reload the view.
$route.reload()

$rootScope.$on 'beforeAnnotationCreated', ->
$scope.clearSelection()

$scope.login = ->
$scope.dialog.visible = true
identity.request {oncancel}
Expand Down

0 comments on commit 3b962a0

Please sign in to comment.