adjust tooltip placement when rendered off screen to the right (previously only happened on the left)

I modified the bootstrap tooltip (and by extension popovers) to include behavior that previously only happened when the tooltip was cut off on the left side of the screen. When a tooltip was activated, if a portion was to be rendered off the left side of the screen, it was shifted to the right and the arrow was moved to the left. This did not happen when cut off to the right side. This code accomplishes the same desired behavior on both sides.