/**
* plugin.js
*
- * Copyright, Moxiecode Systems AB
* Released under LGPL License.
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
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;
}
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) {
if (el.id && focusEditor) {
focusEditor.focus();
} else {
- window.setTimeout(function() {
+ tinymce.util.Delay.setTimeout(function() {
if (!tinymce.Env.webkit) {
window.focus();
}
// 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);
+ }
+ });
});