module.exports = function () {
  var _ = require('lodash'),
    dom = require('../services/dom'),
    focus = require('../decorators/focus');

  function wasTooltipClicked(e) {
    return _.get(e, 'target.classList') && e.target.classList.contains('medium-editor-action');
  }

  /**
   * constructor
   * @param  {Element} el
   * @param  {string} ref   component ref
   * @param  {string} path  dot-delineated path to the data
   * @param  {Element} [oldEl] hold a reference to the old element for inline forms
   */
  function constructor(el, ref, path, oldEl) {
    function outsideClickhandler(e) {
      if (!_.contains(e.path, el) && !wasTooltipClicked(e)) {
        el.dispatchEvent(new CustomEvent('close'));
        this.removeEventListener('click', outsideClickhandler); // note: this references <html>
      }
    }

    // if this is an inline form, add an event handler that will close the form when you click out of it
    if (oldEl) {
      dom.find('html').addEventListener('click', outsideClickhandler);
      // Make sure the event handler on html does not persist after the form is removed.
      dom.onRemove(el, function () {
        dom.find('html').removeEventListener('click', outsideClickhandler);
      });
    }

    this.ref = ref;
    this.path = path;
    this.form = dom.find(el, 'form');
  }

  constructor.prototype = {
    events: {
      submit: 'closeForm',
      close: 'closeForm'
    },

    closeForm: function (e) {
      e.preventDefault();
      focus.unfocus();
    }
  };

  return constructor;
};

@@ -147,26 +147,25 @@
 unction 
-wa
+i
 sTooltip
 Clicked(
@@ -156,25 +156,19 @@
 sTooltip
-Clicked
 (e
+l
 ) %7B%0A    
@@ -178,90 +178,226 @@
 urn 
-_.get(e, 'target.classList') && e.target.classList.contains('medium-editor-action'
+el.classList.contains('medium-editor-toolbar-anchor-preview-inner') %7C%7C el.classList.contains('medium-editor-action');%0A  %7D%0A%0A  function wasTooltipClicked(e) %7B%0A    return _.get(e, 'target.classList') && isTooltip(e.target
 );%0A 

fix anchor previews