use smarter shutdown API

pull/1/head
Tobias Hintze 11 years ago
parent 417540c1d3
commit da12ca4b55

@ -75,11 +75,8 @@ var officeMain = {
joinSession: function(userId, sessionId, cb) { joinSession: function(userId, sessionId, cb) {
cb(memberId); cb(memberId);
}, },
registerCallbackForShutdown: function(webodfShutdownFunction) { callback: function(webodfEditorInstance) {
officeMain.webodfShutdownFunction = webodfShutdownFunction; officeMain.webodfEditorInstance = webodfEditorInstance;
},
callback: function() {
// initialized.
} }
} }
); );
@ -122,22 +119,26 @@ var officeMain = {
onClose: function() { onClose: function() {
"use strict"; "use strict";
// Fade out odf-toolbar officeMain.webodfEditorInstance.shutdown(function() {
$('#odf-toolbar').fadeOut('slow'); // successfull shutdown - all is good.
// Fade out editor
$('#mainContainer').fadeOut('slow', function() { // Fade out odf-toolbar
$('#mainContainer').remove(); $('#odf-toolbar').fadeOut('slow');
$('#odf-canvas').remove(); // Fade out editor
$('.actions,#file_access_panel').fadeIn('slow'); $('#mainContainer').fadeOut('slow', function() {
$('.documentslist, #emptyfolder, #editing-sessions').fadeIn('slow'); $('#mainContainer').remove();
$(document.body).removeClass('claro'); $('#odf-canvas').remove();
$('#office-content').removeClass('wide'); $('.actions,#file_access_panel').fadeIn('slow');
officeMain.webodfShutdownFunction(); $('.documentslist, #emptyfolder, #editing-sessions').fadeIn('slow');
$(document.body).removeClass('claro');
$('#office-content').removeClass('wide');
});
}); });
} }
}; };
$(document).ready(function() { $(document).ready(function() {
"use strict";
$('.documentslist tr').click(function(event) { $('.documentslist tr').click(function(event) {
event.preventDefault(); event.preventDefault();
officeMain.startSession($(this).attr('data-file')); officeMain.startSession($(this).attr('data-file'));

Loading…
Cancel
Save