clean init
This commit is contained in:
parent
265e57e12b
commit
b55cdf5e64
2 changed files with 20 additions and 22 deletions
|
|
@ -57,22 +57,14 @@ module.exports = {
|
|||
})
|
||||
$('#lobby .new').click(function(e){
|
||||
e.stopPropagation()
|
||||
$('#lobby').remove()
|
||||
setTimeout(function(){
|
||||
init([{}],function(){$('#open-toggle, .enable-editor').click();$('.editor-root').trigger('mousedown.editor')})
|
||||
},25)
|
||||
init([{}],function(){$('#open-toggle, .enable-editor').click();$('.editor-root').trigger('mousedown.editor')})
|
||||
})
|
||||
},
|
||||
|
||||
sessionOpen: function(event,data){
|
||||
var data = data || event
|
||||
var session = JSON.parse(data)
|
||||
|
||||
$('#lobby').remove()
|
||||
$('#container').empty().append('<div id="loading"><div class="spinner"></div></div>')
|
||||
setTimeout(function(){
|
||||
init(session,function(){$('#loading').hide()})
|
||||
},25)
|
||||
init(session)
|
||||
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -1,21 +1,27 @@
|
|||
var parsetabs = require('./parser').tabs,
|
||||
ui = require('./ui'),
|
||||
sync = require('./widgets').sync,
|
||||
editorDisable = require('./actions').editorDisable
|
||||
editorDisable = require('./actions').editorDisable,
|
||||
editorInit = require('./editor/init')
|
||||
|
||||
module.exports = function(session,callback) {
|
||||
|
||||
$('#container').empty()
|
||||
$('#lobby').remove()
|
||||
$('#container').empty().append('<div id="loading"><div class="spinner"></div></div>')
|
||||
|
||||
parsetabs(session,$('#container'),true)
|
||||
|
||||
ui.init()
|
||||
|
||||
editorDisable()
|
||||
require('./editor/init')()
|
||||
|
||||
sync()
|
||||
|
||||
if (callback) callback()
|
||||
setTimeout(function(){
|
||||
parsetabs(session,$('#container'),true)
|
||||
setTimeout(function(){
|
||||
$('#open-toggle, .enable-editor').click();$('.editor-root').trigger('mousedown.editor')
|
||||
ui.init()
|
||||
editorDisable()
|
||||
editorInit()
|
||||
sync()
|
||||
if (!callback) return
|
||||
setTimeout(function(){
|
||||
callback()
|
||||
},1)
|
||||
},1)
|
||||
},1)
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue