Skip to content

Commit

Permalink
Issue #18: Keyboard navigation, shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
indigoxela committed Sep 30, 2023
1 parent c226b93 commit 1363595
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions js/tinymce-integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@
editor.ui.registry.addIcon(name, icons[name]);
}
}
// @see https://github.com/backdrop-contrib/tinymce/issues/18
editor.shortcuts.add('ctrl+1', 'Jump to menubar', function () {
let menuBar = document.getElementsByClassName('tox-menubar');
if (menuBar.length) {
menuBar[0].getElementsByTagName('button')[0].focus();
}
});
editor.shortcuts.add('ctrl+2', 'Jump to toolbar', function () {
let myToolBar = document.getElementsByClassName('tox-toolbar-overlord');
if (myToolBar.length) {
myToolBar[0].getElementsByTagName('button')[0].focus();
}
});
});
};

Expand Down

0 comments on commit 1363595

Please sign in to comment.