Skip to content

Commit

Permalink
Fixed bug where tabfocus wouldn't tab properly to other adjacent edit…
Browse files Browse the repository at this point in the history
…or instances.
  • Loading branch information
spocke committed Sep 1, 2014
1 parent cca01dd commit 86098b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
2 changes: 2 additions & 0 deletions changelog.txt
Expand Up @@ -4,6 +4,8 @@ Version 4.1.5 (2014-08-xx)
Fixed bug where empty list elements would result in empty LI elements without it's parent container.
Fixed bug where backspace in empty caret formated element could produce an type error exception of Gecko.
Fixed bug where lists pasted from word with a custom start index above 9 wouldn't be properly handled.
Fixed bug where tabfocus plugin would tab out of the editor instance even if the default action was prevented.
Fixed bug where tabfocus wouldn't tab properly to other adjacent editor instances.
Fixed so custom images for menubutton/splitbutton can be provided. Patch contributed by Naim Hammadi.
Version 4.1.4 (2014-08-21)
Added new media_filter_html option to media plugin that blocks any conditional comments, scripts etc within a video element.
Expand Down
22 changes: 9 additions & 13 deletions js/tinymce/plugins/tabfocus/plugin.js
Expand Up @@ -22,7 +22,7 @@ tinymce.PluginManager.add('tabfocus', function(editor) {
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;
}

Expand All @@ -35,12 +35,8 @@ tinymce.PluginManager.add('tabfocus', function(editor) {
e.style.visibility != "hidden" && canSelectRecursive(e.parentNode));
}

function canSelectInOldIe(el) {
return el.tabIndex || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA";
}

function canSelect(el) {
return ((!canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el);
return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && tinymce.get(e.id) && el.tabIndex != -1 && canSelectRecursive(el);
}

each(el, function(e, i) {
Expand Down Expand Up @@ -112,13 +108,13 @@ tinymce.PluginManager.add('tabfocus', function(editor) {
// 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);
}
if (tinymce.Env.gecko) {
editor.on('keypress keydown', tabHandler);
} else {
editor.on('keydown', tabHandler);
}
});
});

0 comments on commit 86098b3

Please sign in to comment.