Browse Source

Fix scrollToTarget when element id has encoded uri components

Thibaut 11 years ago
parent
commit
e9c9884a13
1 changed files with 3 additions and 1 deletions
  1. 3 1
      assets/javascripts/views/content/content.coffee

+ 3 - 1
assets/javascripts/views/content/content.coffee

@@ -157,7 +157,9 @@ class app.views.Content extends app.View
       $.stopEvent(event)
 
   findTargetByHash: (hash) ->
-    try $.id decodeURIComponent(hash) catch
+    el = try $.id decodeURIComponent(hash) catch
+    el or= try $.id(hash) catch
+    el
 
   isExternalUrl: (url) ->
     url?[0..5] in ['http:/', 'https:']