Skip to content

Commit

Permalink
Syntax tweaks to build cleanly when installed into TinyMCE source.
Browse files Browse the repository at this point in the history
  • Loading branch information
andykellr committed Nov 11, 2013
1 parent f6e932f commit bc683d1
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/tabindex/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,35 @@
//
///////////////////////////////////////////////////////////////////////////

tinymce.PluginManager.add('tabindex', function(editor, url) {
/*global tinymce:true */

editor.on('PostRender', function() {
tinymce.PluginManager.add('tabindex', function(editor) {

editor.on('PostRender', function() {
var iframe, tabindex = editor.settings.tabindex || 'element';

// -1 => don't set a tabindex
if (tabindex === -1) return;
if (tabindex === -1) {
return;
}

// 'element' => grab the tabindex from the element
if (tabindex === 'element') {
tabindex = editor.dom.getAttrib(editor.getElement(), 'tabindex', null);
}

// make sure we have a tabindex
if (!tabindex) return;
if (!tabindex) {
return;
}

// get the iframe so we can set the tabindex
iframe = document.getElementById(editor.id + "_ifr");

// make sure we have an iframe
if (!iframe) return;
if (!iframe) {
return;
}

editor.dom.setAttrib(iframe, 'tabindex', tabindex);
});
Expand Down

0 comments on commit bc683d1

Please sign in to comment.