From 3b962a0630718b152e04cfbe9ab9a86a139ff173 Mon Sep 17 00:00:00 2001 From: Gergely Ujvari Date: Mon, 23 Mar 2015 17:46:07 +0100 Subject: [PATCH] AppController listens to 'beforeAnnotationCreated' 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 --- h/static/scripts/controllers.coffee | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/h/static/scripts/controllers.coffee b/h/static/scripts/controllers.coffee index 23431d65199..ad02a7d27fc 100644 --- a/h/static/scripts/controllers.coffee +++ b/h/static/scripts/controllers.coffee @@ -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 @@ -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}