Skip to content

Commit 1363595

Browse files
committed
Issue #18: Keyboard navigation, shortcuts
1 parent c226b93 commit 1363595

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

js/tinymce-integration.js

+13
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,19 @@
5050
editor.ui.registry.addIcon(name, icons[name]);
5151
}
5252
}
53+
// @see https://github.com/backdrop-contrib/tinymce/issues/18
54+
editor.shortcuts.add('ctrl+1', 'Jump to menubar', function () {
55+
let menuBar = document.getElementsByClassName('tox-menubar');
56+
if (menuBar.length) {
57+
menuBar[0].getElementsByTagName('button')[0].focus();
58+
}
59+
});
60+
editor.shortcuts.add('ctrl+2', 'Jump to toolbar', function () {
61+
let myToolBar = document.getElementsByClassName('tox-toolbar-overlord');
62+
if (myToolBar.length) {
63+
myToolBar[0].getElementsByTagName('button')[0].focus();
64+
}
65+
});
5366
});
5467
};
5568

0 commit comments

Comments
 (0)