function correctHorizontalAlignment () {
      var dropdown = elements.scrollContainer.getBoundingClientRect(),
          styles   = {};
      if (dropdown.right > root.right - MENU_PADDING) {
        styles.left = (hrect.right - dropdown.width) + 'px';
      }
      elements.$.scrollContainer.css(styles);
    }
function correctHorizontalAlignment () {
      var dropdown = elements.scrollContainer.getBoundingClientRect(),
          styles   = {};
      if (dropdown.right > root.right - MENU_PADDING) {
        styles.left = (hrect.right - dropdown.width) + 'px';
      }
      elements.$.scrollContainer.css(styles);
    }
function correctHorizontalAlignment ( ) { var dropdown = elements . scrollContainer . getBoundingClientRect ( ) , styles = { } ; if ( dropdown . right > root . right - MENU_PADDING ) { styles . left = ( hrect . right - dropdown . width ) + 'px' ; } elements . $ . scrollContainer . css ( styles ) ; }
Makes sure that the menu doesn't go off of the screen on either side.
Makes sure that the menu doesn t go off of the screen on either side .