function showInputHelp() {
    // data-acts-as is set for inputs that are an alternative representation
    // of a main element -- e.g., an RTE for a textarea
    let id = $(this).attr('data-acts-as') || this.id;
    // Hide all help texts
    $('.help-text').hide();

    // Show help text for active input
    $(`#${id}-help`).show();

    // We want to avoid pushing down the next form field, so we use
    // absolute positioning if available.
    if (this.getBoundingClientRect && $(`label[for=${id}]`)[0]) {
      let posHelp, posLabel;
      posLabel = $(`label[for=${id}]`)[0].getBoundingClientRect();
      posHelp = $(`#${id}-help`)[0].getBoundingClientRect();

      // Recaculate boundaries for all inputs in case fields have been resized,
      // e.g., textarea via resize triangle. We don't want any help text to
      // start before the rightmost one, so that it doesn't bleed into the
      // control below it
      let maxRight;
      $(this)
        .parents('form')
        .find('input,textarea')
        .each(function() {
          let eleRight = this.getBoundingClientRect().right;
          if (maxRight === undefined || maxRight < eleRight)
            maxRight = eleRight;
        });

      if (posHelp.left > posLabel.right && document.body.clientWidth >= Math.ceil(posLabel.width) + Math.ceil(posHelp.width) + 5) {
        // Position vertically aligned with the input we're showing help for
        let newTopPos = Math.floor(window.scrollY) + Math.floor(posLabel.top);
        let newLeftPos = maxRight + 5;
        let style = `position:absolute;top:${newTopPos}px;display:inline-block;left:${newLeftPos}px;`;
        $(`#${id}-help`).attr('style', style);
      } else {
        // Reset position below input element
        $(`#${id}-help`).attr('style', 'display:inline-block;');
      }
    }
  }
// Show input help for an element bound to `this`.
Show input help for an element bound to `this`.
Show input help for an element bound to ` this ` .
function showInputHelp() {
    let id = $(this).attr('data-acts-as') || this.id;
    $('.help-text').hide();
    $(`#${id}-help`).show();
    if (this.getBoundingClientRect && $(`label[for=${id}]`)[0]) {
      let posHelp, posLabel;
      posLabel = $(`label[for=${id}]`)[0].getBoundingClientRect();
      posHelp = $(`#${id}-help`)[0].getBoundingClientRect();
      let maxRight;
      $(this)
        .parents('form')
        .find('input,textarea')
        .each(function() {
          let eleRight = this.getBoundingClientRect().right;
          if (maxRight === undefined || maxRight < eleRight)
            maxRight = eleRight;
        });
      if (posHelp.left > posLabel.right && document.body.clientWidth >= Math.ceil(posLabel.width) + Math.ceil(posHelp.width) + 5) {
        let newTopPos = Math.floor(window.scrollY) + Math.floor(posLabel.top);
        let newLeftPos = maxRight + 5;
        let style = `position:absolute;top:${newTopPos}px;display:inline-block;left:${newLeftPos}px;`;
        $(`#${id}-help`).attr('style', style);
      } else {
        $(`#${id}-help`).attr('style', 'display:inline-block;');
      }
    }
  }
function showInputHelp ( ) { let id = $ ( this ) . attr ( 'data-acts-as' ) || this . id ; $ ( '.help-text' ) . hide ( ) ; $ ( ` ${ id } ` ) . show ( ) ; if ( this . getBoundingClientRect && $ ( ` ${ id } ` ) [ 0 ] ) { let posHelp , posLabel ; posLabel = $ ( ` ${ id } ` ) [ 0 ] . getBoundingClientRect ( ) ; posHelp = $ ( ` ${ id } ` ) [ 0 ] . getBoundingClientRect ( ) ; let maxRight ; $ ( this ) . parents ( 'form' ) . find ( 'input,textarea' ) . each ( function ( ) { let eleRight = this . getBoundingClientRect ( ) . right ; if ( maxRight === undefined || maxRight < eleRight ) maxRight = eleRight ; } ) ; if ( posHelp . left > posLabel . right && document . body . clientWidth >= Math . ceil ( posLabel . width ) + Math . ceil ( posHelp . width ) + 5 ) { let newTopPos = Math . floor ( window . scrollY ) + Math . floor ( posLabel . top ) ; let newLeftPos = maxRight + 5 ; let style = ` ${ newTopPos } ${ newLeftPos } ` ; $ ( ` ${ id } ` ) . attr ( 'style' , style ) ; } else { $ ( ` ${ id } ` ) . attr ( 'style' , 'display:inline-block;' ) ; } } }
Show input help for an element bound to `this`.
Show input help for an element bound to ` this ` .
// data-acts-as is set for inputs that are an alternative representation // of a main element -- e.g., an RTE for a textarea // Hide all help texts // Show help text for active input // We want to avoid pushing down the next form field, so we use // absolute positioning if available. // Recaculate boundaries for all inputs in case fields have been resized, // e.g., textarea via resize triangle. We don't want any help text to // start before the rightmost one, so that it doesn't bleed into the // control below it // Position vertically aligned with the input we're showing help for // Reset position below input element