import $ from 'jquery';

class IHKPrintShare {
  constructor(wrapper) {
    this.wrapper = wrapper;
    this.initBookmarks();
  }

  initBookmarks() {
    this.bookmarks = this.wrapper.find('.bookmarks');
    this.wrapper.find('.share-mail').on('click', (e) => {
      e.preventDefault();
      this.bookmarks.addClass('show-bookmarks');
    })
  }
}

export default IHKPrintShare;

$('body').on('ihk-init dynamic-component-loaded gfi-dynamic-init', function () {
  $('.print-share:not(.initiated)').each(function () {
    new IHKPrintShare($(this));
  });
});
