From 96053443ae26ddf7a8652bf240088528e3f6d077 Mon Sep 17 00:00:00 2001 From: Matthew Schranz Date: Tue, 2 Jun 2015 15:53:10 -0400 Subject: [PATCH] fix(search): Close modal if on that entity page. Closes #854 --- .../components/quick-search/quick-search.controllers.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/scripts/components/quick-search/quick-search.controllers.ts b/app/scripts/components/quick-search/quick-search.controllers.ts index 360db9ba8..b438d1779 100644 --- a/app/scripts/components/quick-search/quick-search.controllers.ts +++ b/app/scripts/components/quick-search/quick-search.controllers.ts @@ -99,8 +99,12 @@ module ngApp.components.quickSearch.controllers { } goTo(entity, id) { - var options = {}; + if (this.$state.params[entity + "Id"] === id) { + this.$modalInstance.close(); + return; + } + var options = {}; options[entity + "Id"] = id; this.$state.go(entity, options, { inherit: false }); }