function tabHandler(e) {
var x, el, v, i;
- if (e.keyCode !== 9 || e.ctrlKey || e.altKey || e.metaKey) {
+ if (e.keyCode !== 9 || e.ctrlKey || e.altKey || e.metaKey || e.isDefaultPrevented()) {
return;
}
// Remove default tabIndex in inline mode
tinymce.DOM.setAttrib(editor.getBody(), 'tabIndex', null);
}
- });
- editor.on('keyup', tabCancel);
+ editor.on('keyup', tabCancel);
- if (tinymce.Env.gecko) {
- editor.on('keypress keydown', tabHandler);
- } else {
- editor.on('keydown', tabHandler);
- }
+ // Add later so other plugins can preventDefault()
+ if (tinymce.Env.gecko) {
+ editor.on('keypress keydown', tabHandler);
+ } else {
+ editor.on('keydown', tabHandler);
+ }
+ });
});