tinymce.full.js
function moveFocusToIndex(idx, elements) {
        if (idx < 0) {
          idx = elements.length - 1;
        } else if (idx >= elements.length) {
          idx = 0;
        }

        if (elements[idx]) {
          elements[idx].focus();
        }

        return idx;
      }
function moveFocusToIndex(idx, elements) {
        if (idx < 0) {
          idx = elements.length - 1;
        } else if (idx >= elements.length) {
          idx = 0;
        }

        if (elements[idx]) {
          elements[idx].focus();
        }

        return idx;
      }
function moveFocusToIndex ( idx , elements ) { if ( idx < 0 ) { idx = elements . length - 1 ; } else if ( idx >= elements . length ) { idx = 0 ; } if ( elements [ idx ] ) { elements [ idx ] . focus ( ) ; } return idx ; }
Moves the focus to the specified index within the elements list.
This will scope the index to the size of the element list if it changed.

@private
@param {Number} idx Specified index to move to.
@param {Array} elements Array with dom elements to move focus within.
@return {Number} Input index or a changed index if it was out of range.
Moves the focus to the specified index within the elements list . This will scope the index to the size of the element list if it changed .