src/js/ngPopover.js
function(trigger, target){
                    target.classList.toggle('hide');
                    var targetWidth = target.offsetWidth;
                    var targetHeight = target.offsetHeight;
                    target.classList.toggle('hide');
                    var triggerWidth = trigger.offsetWidth;
                    var triggerHeight = trigger.offsetHeight;
                    switch($scope.dropDirection){
                        case 'left': {
                            left = getTriggerOffset().left - targetWidth - 10 + 'px';
                            top = getTriggerOffset().top + 'px';
                            break;
                        }

                        case 'right':{
                            left = getTriggerOffset().left + triggerWidth + 10 + 'px';
                            top = getTriggerOffset().top + 'px';
                            break;
                        } 

                        case'top':{
                            left = getTriggerOffset().left + 'px';
                            top = getTriggerOffset().top - targetHeight - 10 + 'px';
                            break;
                        }

                        default:{
                            left = getTriggerOffset().left +'px';
                            top = getTriggerOffset().top + triggerHeight + 10 + 'px'
                        }
                    }
                    target.style.position = 'absolute';
                    target.style.left = left;
                    target.style.top = top;
                }
function(trigger, target){
                    target.classList.toggle('hide');
                    var targetWidth = target.offsetWidth;
                    var targetHeight = target.offsetHeight;
                    target.classList.toggle('hide');
                    var triggerWidth = trigger.offsetWidth;
                    var triggerHeight = trigger.offsetHeight;
                    switch($scope.dropDirection){
                        case 'left': {
                            left = getTriggerOffset().left - targetWidth - 10 + 'px';
                            top = getTriggerOffset().top + 'px';
                            break;
                        }

                        case 'right':{
                            left = getTriggerOffset().left + triggerWidth + 10 + 'px';
                            top = getTriggerOffset().top + 'px';
                            break;
                        } 

                        case'top':{
                            left = getTriggerOffset().left + 'px';
                            top = getTriggerOffset().top - targetHeight - 10 + 'px';
                            break;
                        }

                        default:{
                            left = getTriggerOffset().left +'px';
                            top = getTriggerOffset().top + triggerHeight + 10 + 'px'
                        }
                    }
                    target.style.position = 'absolute';
                    target.style.left = left;
                    target.style.top = top;
                }
function ( trigger , target ) { target . classList . toggle ( 'hide' ) ; var targetWidth = target . offsetWidth ; var targetHeight = target . offsetHeight ; target . classList . toggle ( 'hide' ) ; var triggerWidth = trigger . offsetWidth ; var triggerHeight = trigger . offsetHeight ; switch ( $scope . dropDirection ) { case 'left' : { left = getTriggerOffset ( ) . left - targetWidth - 10 + 'px' ; top = getTriggerOffset ( ) . top + 'px' ; break ; } case 'right' : { left = getTriggerOffset ( ) . left + triggerWidth + 10 + 'px' ; top = getTriggerOffset ( ) . top + 'px' ; break ; } case 'top' : { left = getTriggerOffset ( ) . left + 'px' ; top = getTriggerOffset ( ) . top - targetHeight - 10 + 'px' ; break ; } default : { left = getTriggerOffset ( ) . left + 'px' ; top = getTriggerOffset ( ) . top + triggerHeight + 10 + 'px' } } target . style . position = 'absolute' ; target . style . left = left ; target . style . top = top ; }
calculates the position of the popover
calculates the position of the popover