aboutsummaryrefslogtreecommitdiff
path: root/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-06-07 22:46:47 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-06-07 22:46:47 +0000
commitceab24db2a7bf459684a650c287770b4ff090f54 (patch)
tree171760af3de53f07b77c12d8e7931241a8d0377e /mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js
parentd924a462f39ff922a4cc9f6635cfe5d0c0f14db3 (diff)
downloadelgg-ceab24db2a7bf459684a650c287770b4ff090f54.tar.gz
elgg-ceab24db2a7bf459684a650c287770b4ff090f54.tar.bz2
Refs #3510, #9113. Updated tinyMCE version in trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@9140 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js')
-rw-r--r--mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js58
1 files changed, 30 insertions, 28 deletions
diff --git a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js
index c2be2f40a..f4545e167 100644
--- a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js
+++ b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js
@@ -22,27 +22,30 @@
var x, i, f, el, v;
function find(d) {
- f = DOM.getParent(ed.id, 'form');
- el = f.elements;
-
- if (f) {
- each(el, function(e, i) {
- if (e.id == ed.id) {
- x = i;
- return false;
- }
- });
-
- if (d > 0) {
- for (i = x + 1; i < el.length; i++) {
- if (el[i].type != 'hidden')
- return el[i];
- }
- } else {
- for (i = x - 1; i >= 0; i--) {
- if (el[i].type != 'hidden')
- return el[i];
- }
+ el = DOM.select(':input:enabled,*[tabindex]');
+ function canSelect(e) {
+ return e.type != 'hidden' &&
+ e.tabIndex != '-1' &&
+ !(el[i].style.display == "none") &&
+ !(el[i].style.visibility == "hidden");
+ }
+
+ each(el, function(e, i) {
+ if (e.id == ed.id) {
+ x = i;
+ return false;
+ }
+ });
+
+ if (d > 0) {
+ for (i = x + 1; i < el.length; i++) {
+ if (canSelect(el[i]))
+ return el[i];
+ }
+ } else {
+ for (i = x - 1; i >= 0; i--) {
+ if (canSelect(el[i]))
+ return el[i];
}
}
@@ -71,10 +74,14 @@
}
if (el) {
- if (ed = tinymce.get(el.id || el.name))
+ if (el.id && (ed = tinymce.get(el.id || el.name)))
ed.focus();
else
- window.setTimeout(function() {window.focus();el.focus();}, 10);
+ window.setTimeout(function() {
+ if (!tinymce.isWebKit)
+ window.focus();
+ el.focus();
+ }, 10);
return Event.cancel(e);
}
@@ -89,11 +96,6 @@
} else
ed.onKeyDown.add(tabHandler);
- ed.onInit.add(function() {
- each(DOM.select('a:first,a:last', ed.getContainer()), function(n) {
- Event.add(n, 'focus', function() {ed.focus();});
- });
- });
},
getInfo : function() {