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

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Thu Mar 26 09:13:21 UTC 2020


 loleaflet/js/global.js                   |   19 +++++++++++++++++++
 loleaflet/src/control/Control.Toolbar.js |   20 --------------------
 2 files changed, 19 insertions(+), 20 deletions(-)

New commits:
commit 3a5d193fdc699ee7056f50eab34b91da15bff037
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Mar 26 10:42:32 2020 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Mar 26 10:13:02 2020 +0100

    Move the window.mode.* functions to global.js for clarity
    
    No idea why they were in Control.Toolbar.js.
    
    Change-Id: I18ab812317b4bfb71d0c63a4cb2283d4fbaa3b54
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91087
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js
index a08c4cf3b..a4fd77bab 100644
--- a/loleaflet/js/global.js
+++ b/loleaflet/js/global.js
@@ -141,6 +141,25 @@
 		retina: (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1
 	};
 
+	global.mode = {
+		// Here "mobile" means "mobile phone" (at least for now). Has to match small screen size
+		// requirement.
+		isMobile: function() {
+			if (L.Browser.mobile && L.Browser.cypressTest) {
+				return true;
+			}
+
+			return L.Browser.mobile && screen.width < 768;
+		},
+		// Mobile device with big screen size.
+		isTablet: function() {
+			return L.Browser.mobile && !window.mode.isMobile();
+		},
+		isDesktop: function() {
+			return !L.Browser.mobile;
+		}
+	};
+
 	document.addEventListener('contextmenu', function(e) {
 		if (e.preventDefault) {
 			e.preventDefault();
diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js
index ca854aa1f..4a115f5e2 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -15,26 +15,6 @@ function onDelete(e) {
 	}
 }
 
-// Make functions visible outside: window.mode.isMobile() etc.
-global.mode = {
-	// Here "mobile" means "mobile phone" (at least for now). Has to match small screen size
-	// requirement.
-	isMobile: function() {
-		if (L.Browser.mobile && L.Browser.cypressTest) {
-			return true;
-		}
-
-		return L.Browser.mobile && screen.width < 768;
-	},
-	// Mobile device with big screen size.
-	isTablet: function() {
-		return L.Browser.mobile && !window.mode.isMobile();
-	},
-	isDesktop: function() {
-		return !L.Browser.mobile;
-	}
-};
-
 var nUsers, oneUser, noUser;
 
 function _updateVisibilityForToolbar(toolbar) {


More information about the Libreoffice-commits mailing list