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

Muhammet Kara (via logerrit) logerrit at kemper.freedesktop.org
Mon Jan 27 13:12:44 UTC 2020


 loleaflet/src/control/Control.Menubar.js |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit 53e6b0d07e8155ec35943021844152b72b816c65
Author:     Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Mon Jan 13 19:46:35 2020 +0300
Commit:     Aron Budea <aron.budea at collabora.com>
CommitDate: Mon Jan 27 14:12:25 2020 +0100

    mobile: Add orientation commands to Page Setup in hamburger menu
    
    It checks for the state of the .uno:Orientation which
    comes from core commit 7285b040ccf619210207c555981beb6df64cfc5a
    
    Change-Id: Idc20f8b6f7c5ba10f5ce4726f4bc4408116dfe6f
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86704
    Reviewed-by: Aron Budea <aron.budea at collabora.com>
    Tested-by: Aron Budea <aron.budea at collabora.com>

diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 9f90ab902..0efc931a3 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -497,6 +497,10 @@ L.Control.Menubar = L.Control.extend({
 				{uno: '.uno:PreviousTrackedChange'},
 				{uno: '.uno:NextTrackedChange'}
 			]},
+			{name: _('Page Setup'), id: 'pagesetup', type: 'menu', menu: [
+				{name: _('Portrait'), id: 'setportrait', uno: '.uno:ToggleOrientation'},
+				{name: _('Landscape'), id: 'setlandscape', uno: '.uno:ToggleOrientation'}
+			]},
 			{name: _UNO('.uno:ViewMenu', 'text'), id: 'view', type: 'menu', menu: [
 				{uno: '.uno:ControlCodes'},
 				{uno: '.uno:SpellOnline'},
@@ -1294,6 +1298,12 @@ L.Control.Menubar = L.Control.extend({
 		if (menuItem.id === 'signdocument' && (L.DomUtil.get('document-signing-bar') === null)) {
 			return false;
 		}
+		if (menuItem.id === 'setportrait' && this._map['stateChangeHandler'].getItemValue('.uno:Orientation') === 'IsPortrait') {
+			return false;
+		}
+		else if (menuItem.id === 'setlandscape' && this._map['stateChangeHandler'].getItemValue('.uno:Orientation') === 'IsLandscape') {
+			return false;
+		}
 		if (this._map._permission === 'readonly' && menuItem.type === 'menu') {
 			var found = false;
 			for (var j in this.options.allowedReadonlyMenus) {


More information about the Libreoffice-commits mailing list