diff --git a/app/assets/javascripts/src/Metamaps.GlobalUI.js.erb b/app/assets/javascripts/src/Metamaps.GlobalUI.js.erb index 2e17ffae..fc2ba6fc 100644 --- a/app/assets/javascripts/src/Metamaps.GlobalUI.js.erb +++ b/app/assets/javascripts/src/Metamaps.GlobalUI.js.erb @@ -614,14 +614,14 @@ Metamaps.GlobalUI.Search = { self.hideLoader(); - if (datum.rtype != "noresult") { + if (["topic", "map", "mapper"].indexOf(datum.rtype) !== -1) { self.close(0, true); var win; - if (dataset == "topics") { + if (datum.rtype == "topic") { Metamaps.Router.topics(datum.id); - } else if (dataset == "maps") { + } else if (datum.rtype == "map") { Metamaps.Router.maps(datum.id); - } else if (dataset == "mappers") { + } else if (datum.rtype == "mapper") { Metamaps.Router.explore("mapper", datum.id); } }