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