tinymce.full.js
function (node, selector, root, collect) {
        var self = this, selectorVal, result = [];

        node = self.get(node);
        collect = collect === undefined;

        // Default root on inline mode
        root = root || (self.getRoot().nodeName != 'BODY' ? self.getRoot().parentNode : null);

        // Wrap node name as func
        if (is(selector, 'string')) {
          selectorVal = selector;

          if (selector === '*') {
            selector = function (node) {
              return node.nodeType == 1;
            };
          } else {
            selector = function (node) {
              return self.is(node, selectorVal);
            };
          }
        }

        while (node) {
          if (node == root || !node.nodeType || node.nodeType === 9) {
            break;
          }

          if (!selector || selector(node)) {
            if (collect) {
              result.push(node);
            } else {
              return node;
            }
          }

          node = node.parentNode;
        }

        return collect ? result : null;
      }
function (node, selector, root, collect) {
        var self = this, selectorVal, result = [];

        node = self.get(node);
        collect = collect === undefined;

        // Default root on inline mode
        root = root || (self.getRoot().nodeName != 'BODY' ? self.getRoot().parentNode : null);

        // Wrap node name as func
        if (is(selector, 'string')) {
          selectorVal = selector;

          if (selector === '*') {
            selector = function (node) {
              return node.nodeType == 1;
            };
          } else {
            selector = function (node) {
              return self.is(node, selectorVal);
            };
          }
        }

        while (node) {
          if (node == root || !node.nodeType || node.nodeType === 9) {
            break;
          }

          if (!selector || selector(node)) {
            if (collect) {
              result.push(node);
            } else {
              return node;
            }
          }

          node = node.parentNode;
        }

        return collect ? result : null;
      }
function ( node , selector , root , collect ) { var self = this , selectorVal , result = [ ] ; node = self . get ( node ) ; collect = collect === undefined ; // Default root on inline mode root = root || ( self . getRoot ( ) . nodeName != 'BODY' ? self . getRoot ( ) . parentNode : null ) ; // Wrap node name as func if ( is ( selector , 'string' ) ) { selectorVal = selector ; if ( selector === '*' ) { selector = function ( node ) { return node . nodeType == 1 ; } ; } else { selector = function ( node ) { return self . is ( node , selectorVal ) ; } ; } } while ( node ) { if ( node == root || ! node . nodeType || node . nodeType === 9 ) { break ; } if ( ! selector || selector ( node ) ) { if ( collect ) { result . push ( node ) ; } else { return node ; } } node = node . parentNode ; } return collect ? result : null ; }
Returns a node list of all parents matching the specified selector function or pattern.
If the function then returns true indicating that it has found what it was looking for and that node will be collected.

@method getParents
@param {Node/String} node DOM node to search parents on or ID string.
@param {function} selector Selection function to execute on each node or CSS pattern.
@param {Node} root Optional root element, never go beyond this point.
@return {Array} Array of nodes or null if it wasn't found.
Returns a node list of all parents matching the specified selector function or pattern . If the function then returns true indicating that it has found what it was looking for and that node will be collected .