if ( offset.left + ( width / 2 ) > $( window ).width() / 2 ) {
                                    // Midpoint of the trigger is on the right side of the viewport.
                                    positionCSS = {
                                        // Right dialog edge aligns with right edge of the trigger.
                                        right: $( window ).width() - ( offset.left + width ),