function scrollIntoView() {
      var doc = this.doc,
          hasScrollBars = doc.documentElement.scrollHeight > doc.documentElement.offsetHeight,
          tempElement = doc._wysihtml5ScrollIntoViewElement = doc._wysihtml5ScrollIntoViewElement || function () {
        var element = doc.createElement("span");
        // The element needs content in order to be able to calculate it's position properly
        element.innerHTML = wysihtml5.INVISIBLE_SPACE;
        return element;
      }(),
          offsetTop;

      if (hasScrollBars) {
        this.insertNode(tempElement);
        offsetTop = _getCumulativeOffsetTop(tempElement);
        tempElement.parentNode.removeChild(tempElement);
        if (offsetTop > doc.body.scrollTop) {
          doc.body.scrollTop = offsetTop;
        }
      }
    }
/**
     * Scroll the current caret position into the view
     * FIXME: This is a bit hacky, there might be a smarter way of doing this
     *
     * @example
     *    selection.scrollIntoView();
     */
Scroll the current caret position into the view
FIXME: This is a bit hacky, there might be a smarter way of doing this


Scroll the current caret position into the view FIXME : This is a bit hacky there might be a smarter way of doing this
function scrollIntoView() {
      var doc = this.doc,
          hasScrollBars = doc.documentElement.scrollHeight > doc.documentElement.offsetHeight,
          tempElement = doc._wysihtml5ScrollIntoViewElement = doc._wysihtml5ScrollIntoViewElement || function () {
        var element = doc.createElement("span");
        element.innerHTML = wysihtml5.INVISIBLE_SPACE;
        return element;
      }(),
          offsetTop;
      if (hasScrollBars) {
        this.insertNode(tempElement);
        offsetTop = _getCumulativeOffsetTop(tempElement);
        tempElement.parentNode.removeChild(tempElement);
        if (offsetTop > doc.body.scrollTop) {
          doc.body.scrollTop = offsetTop;
        }
      }
    }
function scrollIntoView ( ) { var doc = this . doc , hasScrollBars = doc . documentElement . scrollHeight > doc . documentElement . offsetHeight , tempElement = doc . _wysihtml5ScrollIntoViewElement = doc . _wysihtml5ScrollIntoViewElement || function ( ) { var element = doc . createElement ( "span" ) ; element . innerHTML = wysihtml5 . INVISIBLE_SPACE ; return element ; } ( ) , offsetTop ; if ( hasScrollBars ) { this . insertNode ( tempElement ) ; offsetTop = _getCumulativeOffsetTop ( tempElement ) ; tempElement . parentNode . removeChild ( tempElement ) ; if ( offsetTop > doc . body . scrollTop ) { doc . body . scrollTop = offsetTop ; } } }
Scroll the current caret position into the view
 FIXME: This is a bit hacky, there might be a smarter way of doing this
Scroll the current caret position into the view FIXME : This is a bit hacky there might be a smarter way of doing this
// The element needs content in order to be able to calculate it's position properly