Browse Source

Fix searching disabled doc via URL not opening first result correctly

Fixes #604.
Thibaut Courouble 8 years ago
parent
commit
82743163c6

+ 1 - 1
assets/javascripts/views/search/search_scope.coffee

@@ -70,7 +70,7 @@ class app.views.SearchScope extends app.View
   redirectToDoc: (doc) ->
     hash = location.hash
     app.router.replaceHash('')
-    window.location = doc.fullPath() + hash
+    location.assign doc.fullPath() + hash
     return
 
   reset: =>

+ 1 - 1
assets/javascripts/views/sidebar/results.coffee

@@ -46,7 +46,7 @@ class app.views.Results extends app.View
     return
 
   openFirst: ->
-    @el.firstElementChild?.click()
+    setTimeout (=> @el.firstElementChild?.click()), 0
     return
 
   onDocEnabled: (doc) ->