[Libreoffice-commits] online.git: loleaflet/src

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 3 16:50:07 UTC 2020


 loleaflet/src/control/Control.UIManager.js |    5 +++++
 loleaflet/src/main.js                      |    3 ++-
 loleaflet/src/map/Map.js                   |    4 ----
 3 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit a0c6f5ee7de8ae41cf6e7b1fb523a25ca8598101
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Fri Jul 31 17:08:30 2020 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Mon Aug 3 18:49:49 2020 +0200

    loleaflet: create the ruler control only for writer document
    
    The ruler is created only when the document writer layer is initialized
    
    Change-Id: Ie8ea5b466ccb2aca0c91f5c09402bc9028bbdeb8
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99905
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Henry Castro <hcastro at collabora.com>

diff --git a/loleaflet/src/control/Control.UIManager.js b/loleaflet/src/control/Control.UIManager.js
index 7f9d4eb55..8b68b0ab8 100644
--- a/loleaflet/src/control/Control.UIManager.js
+++ b/loleaflet/src/control/Control.UIManager.js
@@ -103,6 +103,11 @@ L.Control.UIManager = L.Control.extend({
 			L.DomUtil.remove(L.DomUtil.get('spreadsheet-row-column-frame'));
 			L.DomUtil.remove(L.DomUtil.get('spreadsheet-toolbar'));
 			L.DomUtil.remove(L.DomUtil.get('presentation-controls-wrapper'));
+
+			if ((window.mode.isTablet() || window.mode.isDesktop())) {
+				var interactiveRuler = this.map.isPermissionEdit();
+				L.control.ruler({position:'topleft', interactive:interactiveRuler}).addTo(this.map);
+			}
 		}
 
 		if (docType === 'presentation' && (isDesktop || window.mode.isTablet())) {
diff --git a/loleaflet/src/main.js b/loleaflet/src/main.js
index 86826522b..6c9130399 100644
--- a/loleaflet/src/main.js
+++ b/loleaflet/src/main.js
@@ -74,6 +74,8 @@ map.addControl(map.uiManager);
 
 map.uiManager.initializeBasicUI();
 
+L.Map.THIS = map;
+
 map.loadDocument(global.socket);
 
 global.socket = map._socket;
@@ -87,6 +89,5 @@ window.addEventListener('beforeunload', function () {
 
 window.docPermission = permission;
 window.bundlejsLoaded = true;
-L.Map.THIS = map;
 
 }(window));
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index ac6c6da9b..13d62dcdd 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -195,10 +195,6 @@ L.Map = L.Evented.extend({
 			if (!this.initComplete) {
 				this._fireInitComplete('doclayerinit');
 			}
-			if ((window.mode.isTablet() || window.mode.isDesktop()) && this._docLayer._docType == 'text') {
-				var interactiveRuler = this.isPermissionEdit();
-				L.control.ruler({position:'topleft', interactive:interactiveRuler}).addTo(this);
-			}
 
 			// We need core's knowledge of whether it is a mobile phone
 			// or not to be in sync with the test in _onJSDialogMsg in TileLayer.js.


More information about the Libreoffice-commits mailing list