extensions/amp-pinterest/0.1/pin-widget.js
/**
   * Override the default href click handling to log and open popup
   * @param {Event} event: the HTML event object
   */
Override the default href click handling to log and open popup
@param {Event} event: the HTML event object
Override the default href click handling to log and open popup @param { Event } event : the HTML event object
handleClick(event) {
    event.preventDefault();
    const el = event.target;
    const shouldPop = el.getAttribute('data-pin-pop') || false;
    const href = el.getAttribute('data-pin-href');
    const log = el.getAttribute('data-pin-log');
    if (href) {
      if (shouldPop) {
        openWindowDialog(window, href, '_pinit', POP);
      } else {
        openWindowDialog(window, `${href}?amp=1&guid=${Util.guid}`, '_blank');
      }
    }
    if (log) {
      Util.log('&type=' + log);
    }
  }
handleClick ( event ) { event . preventDefault ( ) ; const el = event . target ; const shouldPop = el . getAttribute ( 'data-pin-pop' ) || false ; const href = el . getAttribute ( 'data-pin-href' ) ; const log = el . getAttribute ( 'data-pin-log' ) ; if ( href ) { if ( shouldPop ) { openWindowDialog ( window , href , '_pinit' , POP ) ; } else { openWindowDialog ( window , ` ${ href } ${ Util . guid } ` , '_blank' ) ; } } if ( log ) { Util . log ( '&type=' + log ) ; } }
Override the default href click handling to log and open popup
 @param {Event} event: the HTML event object
Override the default href click handling to log and open popup @param { Event } event : the HTML event object