From 52aa2941cdec19bc8f675508c799e654d5609fb6 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Mon, 26 Oct 2015 12:34:31 +0100 Subject: [PATCH] cloudsuite: Order the loading of the JS pieces. --- js/documents.js | 67 ++++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/js/documents.js b/js/documents.js index edf89f65..4e2f517c 100644 --- a/js/documents.js +++ b/js/documents.js @@ -197,41 +197,44 @@ var documentsMain = { }, showEditor : function(title){ - OC.addScript('documents', '3rdparty/cloudsuite/jquery.min'); - OC.addScript('documents', '3rdparty/cloudsuite/w2ui.min'); - OC.addScript('documents', '3rdparty/cloudsuite/select2.min'); - - // start the loleaflet - OC.addScript('documents', '3rdparty/cloudsuite/leaflet-src').done(function() { - var map = L.map('map', { - server: 'ws://localhost:9980', - doc: 'file:///local/home/kendy/Downloads/ODT-test.odt', - edit: true, - timestamp: '', - /*server: host, - doc: filePath, - edit: edit, - timestamp: timestamp,*/ - readOnly: false + OC.addScript('documents', '3rdparty/cloudsuite/jquery.min').done(function() { + OC.addScript('documents', '3rdparty/cloudsuite/w2ui.min').done(function() { + OC.addScript('documents', '3rdparty/cloudsuite/select2.min').done(function() { + OC.addScript('documents', '3rdparty/cloudsuite/leaflet-src').done(function() { + OC.addScript('documents', '3rdparty/cloudsuite/leaflet.draw').done(function() { + OC.addScript('documents', '3rdparty/cloudsuite/jquery.mCustomScrollbar').done(function() { + OC.addScript('documents', '3rdparty/cloudsuite/vex.combined.min').done(function() { + //vex.defaultOptions.className = 'vex-theme-plain'; + + var map = L.map('map', { + server: 'ws://localhost:9980', + doc: 'file:///local/home/kendy/Downloads/ODT-test.odt', + edit: true, + timestamp: '', + /*server: host, + doc: filePath, + edit: edit, + timestamp: timestamp,*/ + readOnly: false + }); + + ////// Controls ///// + map.addControl(L.control.scroll()); + map.addControl(L.control.dialog()); + map.addControl(L.control.partsPreview()); + map.addControl(L.control.tabs()); + + OC.addScript('documents', '3rdparty/cloudsuite/cloudsuite.js'); + + documentsMain.overlay.documentOverlay('hide'); + }); + }); + }); + }); + }); }); - - ////// Controls ///// - map.addControl(L.control.scroll()); - map.addControl(L.control.dialog()); - map.addControl(L.control.partsPreview()); - map.addControl(L.control.tabs()); - - OC.addScript('documents', '3rdparty/cloudsuite/cloudsuite.js'); - - documentsMain.overlay.documentOverlay('hide'); }); - OC.addScript('documents', '3rdparty/cloudsuite/leaflet.draw'); - OC.addScript('documents', '3rdparty/cloudsuite/jquery.mCustomScrollbar'); - OC.addScript('documents', '3rdparty/cloudsuite/vex.combined.min'); - - //vex.defaultOptions.className = 'vex-theme-plain'; - if (documentsMain.isGuest){ // !Login page mess wih WebODF toolbars $(document.body).attr('id', 'body-user');