History

Improve app loading sequence

Thibaut Courouble committed 9 years ago

Commit 74286451 parent 9e9735710 files · +44 −65Browse files

Showing the changes to assets/javascripts (1 of 10 files). Show all

Unified · Split

assets/javascripts/app/app.coffee+6−13
@@ -10,7 +10,6 @@ · 9 unmodified lines
10 init: ->10 init: ->
11 try @initErrorTracking() catch11 try @initErrorTracking() catch
12 return unless @browserCheck()12 return unless @browserCheck()
13 @showLoading()
14 13
15 @el = $('._app')14 @el = $('._app')
16 @localStorage = new LocalStorageStore15 @localStorage = new LocalStorageStore
@@ -38,8 +37,8 @@ · 21 unmodified lines
38 37
39 browserCheck: ->38 browserCheck: ->
40 return true if @isSupportedBrowser()39 return true if @isSupportedBrowser()
41 document.body.className = ''
42 document.body.innerHTML = app.templates.unsupportedBrowser40 document.body.innerHTML = app.templates.unsupportedBrowser
41 @hideLoadingScreen()
43 false42 false
44 43
45 initErrorTracking: ->44 initErrorTracking: ->
@@ -103,7 +102,7 @@ · 57 unmodified lines
103 @initDoc(doc) for doc in @docs.all()102 @initDoc(doc) for doc in @docs.all()
104 @trigger 'ready'103 @trigger 'ready'
105 @router.start()104 @router.start()
106 @hideLoading()105 @hideLoadingScreen()
107 setTimeout =>106 setTimeout =>
108 @welcomeBack() unless @doc107 @welcomeBack() unless @doc
109 @removeEvent 'ready bootError'108 @removeEvent 'ready bootError'
@@ -181,15 +180,9 @@ · 71 unmodified lines
181 new app.views.Tip(tip)180 new app.views.Tip(tip)
182 return181 return
183 182
184 showLoading: ->183 hideLoadingScreen: ->
185 document.body.classList.remove '_noscript'
186 document.body.classList.add '_loading'
187 return
188
189 hideLoading: ->
190 document.body.classList.add '_overlay-scrollbars' if $.overlayScrollbarsEnabled()184 document.body.classList.add '_overlay-scrollbars' if $.overlayScrollbarsEnabled()
191 document.body.classList.remove '_booting'185 document.documentElement.classList.remove '_booting'
192 document.body.classList.remove '_loading'
193 return186 return
194 187
195 indexHost: ->188 indexHost: ->
@@ -199,7 +192,7 @@ · 3 unmodified lines
199 192
200 onBootError: (args...) ->193 onBootError: (args...) ->
201 @trigger 'bootError'194 @trigger 'bootError'
202 @hideLoading()195 @hideLoadingScreen()
203 return196 return
204 197
205 onQuotaExceeded: ->198 onQuotaExceeded: ->
@@ -221,7 +214,7 @@ · 15 unmodified lines
221 @onInjectionError()214 @onInjectionError()
222 else if @isAppError args...215 else if @isAppError args...
223 @previousErrorHandler? args...216 @previousErrorHandler? args...
224 @hideLoading()217 @hideLoadingScreen()
225 @errorNotif or= new app.views.Notif 'Error'218 @errorNotif or= new app.views.Notif 'Error'
226 @errorNotif.show()219 @errorNotif.show()
227 return220 return

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t