function show() {
            var position,
                ttWidth,
                ttHeight,
                ttPosition;

            // Don't show empty tooltips.
            if ( ! scope.tt_content ) {
              return;
            }

            // If there is a pending remove transition, we must cancel it, lest the
            // tooltip be mysteriously removed.
            if ( transitionTimeout ) {
              $timeout.cancel( transitionTimeout );
            }
            
            // Set the initial positioning.
            tooltip.css({ top: 0, left: 0, display: 'block' });
            
            // Now we add it to the DOM because need some info about it. But it's not 
            // visible yet anyway.
            if ( appendToBody ) {
                $body = $body || $document.find( 'body' );
                $body.append( tooltip );
            } else {
              element.after( tooltip );
            }

            // Get the position of the directive element.
            position = appendToBody ? $position.offset( element ) : $position.position( element );

            // Get the height and width of the tooltip so we can center it.
            ttWidth = tooltip.prop( 'offsetWidth' );
            ttHeight = tooltip.prop( 'offsetHeight' );
            
            // Calculate the tooltip's top and left coordinates to center it with
            // this directive.
            switch ( scope.tt_placement ) {
              case 'mouse':
                var mousePos = $position.mouse();
                ttPosition = {
                  top: mousePos.y,
                  left: mousePos.x
                };
                break;
              case 'right':
                ttPosition = {
                  top: position.top + position.height / 2 - ttHeight / 2,
                  left: position.left + position.width
                };
                break;
              case 'bottom':
                ttPosition = {
                  top: position.top + position.height,
                  left: position.left + position.width / 2 - ttWidth / 2
                };
                break;
              case 'left':
                ttPosition = {
                  top: position.top + position.height / 2 - ttHeight / 2,
                  left: position.left - ttWidth
                };
                break;
              default:
                ttPosition = {
                  top: position.top - ttHeight,
                  left: position.left + position.width / 2 - ttWidth / 2
                };
                break;
            }

            ttPosition.top += 'px';
            ttPosition.left += 'px';

            // Now set the calculated positioning.
            tooltip.css( ttPosition );
              
            // And show the tooltip.
            scope.tt_isOpen = true;
          }
// Show the tooltip popup element.
Show the tooltip popup element.
Show the tooltip popup element .
function show() {
            var position,
                ttWidth,
                ttHeight,
                ttPosition;
            if ( ! scope.tt_content ) {
              return;
            }
            if ( transitionTimeout ) {
              $timeout.cancel( transitionTimeout );
            }
            tooltip.css({ top: 0, left: 0, display: 'block' });
            if ( appendToBody ) {
                $body = $body || $document.find( 'body' );
                $body.append( tooltip );
            } else {
              element.after( tooltip );
            }
            position = appendToBody ? $position.offset( element ) : $position.position( element );
            ttWidth = tooltip.prop( 'offsetWidth' );
            ttHeight = tooltip.prop( 'offsetHeight' );
            switch ( scope.tt_placement ) {
              case 'mouse':
                var mousePos = $position.mouse();
                ttPosition = {
                  top: mousePos.y,
                  left: mousePos.x
                };
                break;
              case 'right':
                ttPosition = {
                  top: position.top + position.height / 2 - ttHeight / 2,
                  left: position.left + position.width
                };
                break;
              case 'bottom':
                ttPosition = {
                  top: position.top + position.height,
                  left: position.left + position.width / 2 - ttWidth / 2
                };
                break;
              case 'left':
                ttPosition = {
                  top: position.top + position.height / 2 - ttHeight / 2,
                  left: position.left - ttWidth
                };
                break;
              default:
                ttPosition = {
                  top: position.top - ttHeight,
                  left: position.left + position.width / 2 - ttWidth / 2
                };
                break;
            }
            ttPosition.top += 'px';
            ttPosition.left += 'px';
            tooltip.css( ttPosition );
            scope.tt_isOpen = true;
          }
function show ( ) { var position , ttWidth , ttHeight , ttPosition ; if ( ! scope . tt_content ) { return ; } if ( transitionTimeout ) { $timeout . cancel ( transitionTimeout ) ; } tooltip . css ( { top : 0 , left : 0 , display : 'block' } ) ; if ( appendToBody ) { $body = $body || $document . find ( 'body' ) ; $body . append ( tooltip ) ; } else { element . after ( tooltip ) ; } position = appendToBody ? $position . offset ( element ) : $position . position ( element ) ; ttWidth = tooltip . prop ( 'offsetWidth' ) ; ttHeight = tooltip . prop ( 'offsetHeight' ) ; switch ( scope . tt_placement ) { case 'mouse' : var mousePos = $position . mouse ( ) ; ttPosition = { top : mousePos . y , left : mousePos . x } ; break ; case 'right' : ttPosition = { top : position . top + position . height / 2 - ttHeight / 2 , left : position . left + position . width } ; break ; case 'bottom' : ttPosition = { top : position . top + position . height , left : position . left + position . width / 2 - ttWidth / 2 } ; break ; case 'left' : ttPosition = { top : position . top + position . height / 2 - ttHeight / 2 , left : position . left - ttWidth } ; break ; default : ttPosition = { top : position . top - ttHeight , left : position . left + position . width / 2 - ttWidth / 2 } ; break ; } ttPosition . top += 'px' ; ttPosition . left += 'px' ; tooltip . css ( ttPosition ) ; scope . tt_isOpen = true ; }
Show the tooltip popup element.
Show the tooltip popup element .
// Don't show empty tooltips. // If there is a pending remove transition, we must cancel it, lest the // tooltip be mysteriously removed. // Set the initial positioning. // Now we add it to the DOM because need some info about it. But it's not  // visible yet anyway. // Get the position of the directive element. // Get the height and width of the tooltip so we can center it. // Calculate the tooltip's top and left coordinates to center it with // this directive. // Now set the calculated positioning. // And show the tooltip.