summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2022-04-04 09:26:16 +0200
committerpedropintosilva <65948705+pedropintosilva@users.noreply.github.com>2022-04-05 12:37:35 +0200
commit2254f66403886aa3dc97ea1cc2bd64a6df34cf32 (patch)
tree663fbf08be1a40a8a7644e5c5dcecf8f644ed256
parentclipboard: notebookbar: show hint with keyboard shortcuts for Paste (diff)
downloadonline-2254f66403886aa3dc97ea1cc2bd64a6df34cf32.tar.gz
online-2254f66403886aa3dc97ea1cc2bd64a6df34cf32.zip
clipboard: add Paste Special also in context menu
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com> Change-Id: Ie21afe6e73dac736d6db99a6a2320f0c2dbc2e71
-rw-r--r--loleaflet/src/control/Control.ContextMenu.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/loleaflet/src/control/Control.ContextMenu.js b/loleaflet/src/control/Control.ContextMenu.js
index 00699c959f..a039291b3b 100644
--- a/loleaflet/src/control/Control.ContextMenu.js
+++ b/loleaflet/src/control/Control.ContextMenu.js
@@ -20,7 +20,7 @@ L.Control.ContextMenu = L.Control.extend({
* in following list is just for reference and ease of locating uno command
* from context menu structure.
*/
- general: ['Cut', 'Copy', 'Paste', 'Delete',
+ general: ['Cut', 'Copy', 'Paste', 'PasteSpecial', 'Delete',
'NumberingStart', 'ContinueNumbering', 'IncrementLevel', 'DecrementLevel',
'OpenHyperlinkOnCursor', 'EditHyperlink', 'CopyHyperlinkLocation', 'RemoveHyperlink',
'AnchorMenu', 'SetAnchorToPage', 'SetAnchorToPara', 'SetAnchorAtChar',
@@ -193,6 +193,15 @@ L.Control.ContextMenu = L.Control.extend({
continue;
}
+ // reduce Paste Special submenu
+ if (item.type === 'menu' && item.text.replace('~', '') === 'Paste Special'
+ && item.menu && item.menu.length) {
+ item.text = _('Paste Special');
+ item.command = '.uno:PasteSpecial';
+ item.type = item.menu[0].type;
+ item.menu = undefined;
+ }
+
if (item.type === 'separator') {
if (isLastItemText) {
contextMenu['sep' + sepIdx++] = this.options.SEPARATOR;
@@ -254,10 +263,6 @@ L.Control.ContextMenu = L.Control.extend({
isLastItemText = true;
} else if (item.type === 'menu') {
itemName = item.text;
- if (itemName.replace('~', '') === 'Paste Special') {
- itemName = _('Paste Special');
- continue; // Kill paste special for now.
- }
var submenu = this._createContextMenuStructure(item);
// ignore submenus with all items disabled
if (Object.keys(submenu).length === 0) {