Unified · Split
| @@ -85,7 +85,7 @@ class app.views.Content extends app.View · 84 unmodified lines | ||
| 85 | 85 | return |
| 86 | 86 | |
| 87 | 87 | scrollToTarget: -> |
| 88 | − if @routeCtx.hash and el = $.id @routeCtx.hash | |
| 88 | + if @routeCtx.hash and el = @findTargetByHash @routeCtx.hash | |
| 89 | 89 | $.scrollToWithImageLock el, @scrollEl, 'top', |
| 90 | 90 | margin: 20 + if @scrollEl is @el then 0 else $.offset(@el).top |
| 91 | 91 | $.highlight el, className: '_highlight' |
| @@ -150,5 +150,8 @@ class app.views.Content extends app.View · 58 unmodified lines | ||
| 150 | 150 | $.popup(link) |
| 151 | 151 | return |
| 152 | 152 | |
| 153 | + findTargetByHash: (hash) -> | |
| 154 | + try $.id decodeURIComponent(hash) catch | |
| 155 | + | |
| 153 | 156 | isExternalUrl: (url) -> |
| 154 | 157 | url?[0..3] is 'http' |