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
1010 init: ->
1111 try @initErrorTracking() catch
1212 return unless @browserCheck()
13− @showLoading()
1413
1514 @el = $('._app')
1615 @localStorage = new LocalStorageStore
@@ -38,8 +37,8 @@ · 21 unmodified lines
3837
3938 browserCheck: ->
4039 return true if @isSupportedBrowser()
41− document.body.className = ''
4240 document.body.innerHTML = app.templates.unsupportedBrowser
41+ @hideLoadingScreen()
4342 false
4443
4544 initErrorTracking: ->
@@ -103,7 +102,7 @@ · 57 unmodified lines
103102 @initDoc(doc) for doc in @docs.all()
104103 @trigger 'ready'
105104 @router.start()
106− @hideLoading()
105+ @hideLoadingScreen()
107106 setTimeout =>
108107 @welcomeBack() unless @doc
109108 @removeEvent 'ready bootError'
@@ -181,15 +180,9 @@ · 71 unmodified lines
181180 new app.views.Tip(tip)
182181 return
183182
184− showLoading: ->
185− document.body.classList.remove '_noscript'
186− document.body.classList.add '_loading'
187− return
188−
189− hideLoading: ->
183+ hideLoadingScreen: ->
190184 document.body.classList.add '_overlay-scrollbars' if $.overlayScrollbarsEnabled()
191− document.body.classList.remove '_booting'
192− document.body.classList.remove '_loading'
185+ document.documentElement.classList.remove '_booting'
193186 return
194187
195188 indexHost: ->
@@ -199,7 +192,7 @@ · 3 unmodified lines
199192
200193 onBootError: (args...) ->
201194 @trigger 'bootError'
202− @hideLoading()
195+ @hideLoadingScreen()
203196 return
204197
205198 onQuotaExceeded: ->
@@ -221,7 +214,7 @@ · 15 unmodified lines
221214 @onInjectionError()
222215 else if @isAppError args...
223216 @previousErrorHandler? args...
224− @hideLoading()
217+ @hideLoadingScreen()
225218 @errorNotif or= new app.views.Notif 'Error'
226219 @errorNotif.show()
227220 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