From ddae1f9da3871a034af8f2bb040faf8fa63ed1b3 Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Tue, 1 Jun 2021 18:38:08 +0300 Subject: [PATCH] [PE mobile] Bug 49391 --- apps/presentationeditor/mobile/locale/en.json | 7 ++- .../mobile/src/controller/ContextMenu.jsx | 50 +++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/apps/presentationeditor/mobile/locale/en.json b/apps/presentationeditor/mobile/locale/en.json index c83fb611a..5f469fd96 100644 --- a/apps/presentationeditor/mobile/locale/en.json +++ b/apps/presentationeditor/mobile/locale/en.json @@ -132,7 +132,10 @@ "ContextMenu": { "menuViewComment": "View Comment", "menuAddComment": "Add Comment", + "menuMerge": "Merge", + "menuSplit": "Split", "menuDelete": "Delete", + "menuDeleteTable": "Delete Table", "menuEdit": "Edit", "menuAddLink": "Add Link", "menuOpenLink": "Open Link", @@ -140,7 +143,9 @@ "menuCancel": "Cancel", "textCopyCutPasteActions": "Copy, Cut and Paste Actions", "errorCopyCutPaste": "Copy, cut and paste actions using the context menu will be performed within the current file only.", - "textDoNotShowAgain": "Don't show again" + "textDoNotShowAgain": "Don't show again", + "textColumns": "Columns", + "textRows": "Rows" }, "Toolbar": { "dlgLeaveTitleText": "You leave the application", diff --git a/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx b/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx index e72ce5d66..fde237e74 100644 --- a/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx +++ b/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx @@ -117,6 +117,56 @@ class ContextMenu extends ContextMenuController { }).open(); } + showSplitModal() { + const { t } = this.props; + const _t = t("ContextMenu", { returnObjects: true }); + let picker; + const dialog = f7.dialog.create({ + title: _t.menuSplit, + text: '', + content: `
+
+
${_t.textColumns}
+
${_t.textRows}
+
+
+
`, + buttons: [ + { + text: _t.menuCancel + }, + { + text: 'OK', + bold: true, + onClick: function () { + const size = picker.value; + Common.EditorApi.get().SplitCell(parseInt(size[0]), parseInt(size[1])); + } + } + ] + }).open(); + dialog.on('opened', () => { + picker = f7.picker.create({ + containerEl: document.getElementById('picker-split-size'), + cols: [ + { + textAlign: 'center', + width: '100%', + values: [1,2,3,4,5,6,7,8,9,10] + }, + { + textAlign: 'center', + width: '100%', + values: [1,2,3,4,5,6,7,8,9,10] + } + ], + toolbar: false, + rotateEffect: true, + value: [3, 3] + }); + }); + } + openLink(url) { const api = Common.EditorApi.get(); if (api.asc_getUrlType(url) > 0) {