docs: function adjustRect(rect, adjustX, adjustY, ev) {
              // if pageX or pageY is defined we need to lock the popover to the given
              // x and y position.
              // clone the rect, so we can manipulate its properties.
              var localRect = {
                bottom: rect.bottom,
                height: rect.height,
                left: rect.left,
                right: rect.right,
                top: rect.top,
                width: rect.width
              };
  
              if (adjustX) {
                localRect.left = ev.pageX;
                localRect.right = ev.pageX;
                localRect.width = 0;
              }
  
              if (adjustY) {
                localRect.top = ev.pageY;
                localRect.bottom = ev.pageY;
                localRect.height = 0;
              }
  
              return localRect;
            }