From a476af9126dfb653a4067363378f61cdb8278b7e Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Mon, 26 Oct 2015 11:04:37 +0100 Subject: [PATCH] cloudsuite: Actually start the loleaflet. [Still webodf appears on too many places, so loleaflet does not get visible yet.] --- js/documents.js | 53 +++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/js/documents.js b/js/documents.js index 028db258..832f1ded 100644 --- a/js/documents.js +++ b/js/documents.js @@ -164,6 +164,14 @@ var documentsMain = { '
' + ' ' + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + '', /*'
' + '
' + @@ -192,7 +200,30 @@ var documentsMain = { OC.addScript('documents', '3rdparty/cloudsuite/jquery.min'); OC.addScript('documents', '3rdparty/cloudsuite/w2ui.min'); OC.addScript('documents', '3rdparty/cloudsuite/select2.min'); - OC.addScript('documents', '3rdparty/cloudsuite/leaflet-src'); + + // 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 + }); + + ////// 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'); + }); + OC.addScript('documents', '3rdparty/cloudsuite/leaflet.draw'); OC.addScript('documents', '3rdparty/cloudsuite/jquery.mCustomScrollbar'); OC.addScript('documents', '3rdparty/cloudsuite/vex.combined.min'); @@ -209,26 +240,6 @@ var documentsMain = { // in case we are on the public sharing page we shall display the odf into the preview tag //$('#preview').html(container); $('title').text(title + ' - ' + documentsMain.UI.mainTitle); - - 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'); }, hideEditor : function(){