function highlightControlWithBubble(element, rawQuery) {
    let searchBubble = element.querySelector(`.${SEARCH_BUBBLE_CSS_CLASS}`);
    // If the element has already been highlighted, there is no need to do
    // anything.
    if (searchBubble)
      return;

    searchBubble = document.createElement('div');
    searchBubble.classList.add(SEARCH_BUBBLE_CSS_CLASS);
    const innards = document.createElement('div');
    innards.classList.add('search-bubble-innards');
    innards.textContent = rawQuery;
    searchBubble.appendChild(innards);
    element.appendChild(searchBubble);

    const updatePosition = function() {
      searchBubble.style.top = element.offsetTop +
          (innards.classList.contains('above') ? -searchBubble.offsetHeight :
                                                 element.offsetHeight) +
          'px';
    };
    updatePosition();

    searchBubble.addEventListener('mouseover', function() {
      innards.classList.toggle('above');
      updatePosition();
    });
  }
/**
   * Highlights an HTML element by displaying a search bubble. The element
   * should already be visible or the bubble will render incorrectly.
   * @param {!HTMLElement} element The element to be highlighted.
   * @param {string} rawQuery The search query.
   * @private
   */
Highlights an HTML element by displaying a search bubble. The element
should already be visible or the bubble will render incorrectly.
@param {!HTMLElement} element The element to be highlighted.
@param {string} rawQuery The search query.
@private
Highlights an HTML element by displaying a search bubble . The element should already be visible or the bubble will render incorrectly . @param { !HTMLElement } element The element to be highlighted . @param { string } rawQuery The search query . @private
function highlightControlWithBubble(element, rawQuery) {
    let searchBubble = element.querySelector(`.${SEARCH_BUBBLE_CSS_CLASS}`);
    if (searchBubble)
      return;
    searchBubble = document.createElement('div');
    searchBubble.classList.add(SEARCH_BUBBLE_CSS_CLASS);
    const innards = document.createElement('div');
    innards.classList.add('search-bubble-innards');
    innards.textContent = rawQuery;
    searchBubble.appendChild(innards);
    element.appendChild(searchBubble);
    const updatePosition = function() {
      searchBubble.style.top = element.offsetTop +
          (innards.classList.contains('above') ? -searchBubble.offsetHeight :
                                                 element.offsetHeight) +
          'px';
    };
    updatePosition();
    searchBubble.addEventListener('mouseover', function() {
      innards.classList.toggle('above');
      updatePosition();
    });
  }
function highlightControlWithBubble ( element , rawQuery ) { let searchBubble = element . querySelector ( ` ${ SEARCH_BUBBLE_CSS_CLASS } ` ) ; if ( searchBubble ) return ; searchBubble = document . createElement ( 'div' ) ; searchBubble . classList . add ( SEARCH_BUBBLE_CSS_CLASS ) ; const innards = document . createElement ( 'div' ) ; innards . classList . add ( 'search-bubble-innards' ) ; innards . textContent = rawQuery ; searchBubble . appendChild ( innards ) ; element . appendChild ( searchBubble ) ; const updatePosition = function ( ) { searchBubble . style . top = element . offsetTop + ( innards . classList . contains ( 'above' ) ? - searchBubble . offsetHeight : element . offsetHeight ) + 'px' ; } ; updatePosition ( ) ; searchBubble . addEventListener ( 'mouseover' , function ( ) { innards . classList . toggle ( 'above' ) ; updatePosition ( ) ; } ) ; }
Highlights an HTML element by displaying a search bubble.
Highlights an HTML element by displaying a search bubble .
// If the element has already been highlighted, there is no need to do // anything.