Showing the changes to assets/javascripts (1 of 1 file). Show all
Unified · Split
| @@ -51,6 +51,9 @@ class app.views.Content extends app.View · 50 unmodified lines | |||
| 51 | @addClass @constructor.loadingClass | 51 | @addClass @constructor.loadingClass |
| 52 | return | 52 | return |
| 53 | 53 | ||
| 54 | isLoading: -> | ||
| 55 | @el.classList.contains @constructor.loadingClass | ||
| 56 | |||
| 54 | hideLoading: -> | 57 | hideLoading: -> |
| 55 | @removeClass @constructor.loadingClass | 58 | @removeClass @constructor.loadingClass |
| 56 | return | 59 | return |
| @@ -92,12 +95,14 @@ class app.views.Content extends app.View · 35 unmodified lines | |||
| 92 | return | 95 | return |
| 93 | 96 | ||
| 94 | scrollToTarget: -> | 97 | scrollToTarget: -> |
| 98 | return if @isLoading() | ||
| 95 | if @routeCtx.hash and el = @findTargetByHash @routeCtx.hash | 99 | if @routeCtx.hash and el = @findTargetByHash @routeCtx.hash |
| 96 | $.scrollToWithImageLock el, @scrollEl, 'top', | 100 | $.scrollToWithImageLock el, @scrollEl, 'top', |
| 97 | margin: 20 + if @scrollEl is @el then 0 else $.offset(@el).top | 101 | margin: 20 + if @scrollEl is @el then 0 else $.offset(@el).top |
| 98 | $.highlight el, className: '_highlight' | 102 | $.highlight el, className: '_highlight' |
| 99 | else | 103 | else |
| 100 | @scrollTo @scrollMap[@routeCtx.state.id] | 104 | @scrollTo @scrollMap[@routeCtx.state.id] |
| 105 | clearTimeout @scrollTimeout | ||
| 101 | return | 106 | return |
| 102 | 107 | ||
| 103 | onReady: => | 108 | onReady: => |
| @@ -121,7 +126,7 @@ class app.views.Content extends app.View · 17 unmodified lines | |||
| 121 | beforeRoute: (context) => | 126 | beforeRoute: (context) => |
| 122 | @cacheScrollPosition() | 127 | @cacheScrollPosition() |
| 123 | @routeCtx = context | 128 | @routeCtx = context |
| 124 | @delay @scrollToTarget | 129 | @scrollTimeout = @delay @scrollToTarget |
| 125 | return | 130 | return |
| 126 | 131 | ||
| 127 | cacheScrollPosition: -> | 132 | cacheScrollPosition: -> |