mapping
7 years ago
angular-chosen.directive.js
7 years ago
attributes.service.js
7 years ago
autodetect.directive.js
7 years ago
cascade.directive.js
7 years ago
contenteditable.directive.js
7 years ago
currency.service.js
7 years ago
droppable.directive.js
7 years ago
export.service.js
7 years ago
focusMeWhenEnabled.directive.js
7 years ago
googleCategoriesService.js
7 years ago
main.controller.js
7 years ago
styledInput.directive.js
7 years ago
template.service.js
7 years ago
tipsy.directive.js
7 years ago
wpHttp.service.js
7 years ago
tipsy.directive.js
26 lines
| 1 | GoogleMerchants.directive('tipsy', ['$document', function($document) { |
| 2 | return { |
| 3 | restrict: 'A', |
| 4 | link: function (scope, element, attributes) { |
| 5 | element.attr('original-title', attributes.tipsy); |
| 6 | element.tipsy({ |
| 7 | gravity: function() { |
| 8 | var ver = 'n'; |
| 9 | if ($document.scrollTop() < element.offset().top - angular.element('.tipsy').height() - 2) { |
| 10 | ver = 's'; |
| 11 | } |
| 12 | var hor = ''; |
| 13 | if (element.offset().left + angular.element('.tipsy').width() < $document.width() + $document.scrollLeft()) { |
| 14 | hor = 'w'; |
| 15 | } else if (element.offset().left - angular.element('.tipsy').width() > $document.scrollLeft()) { |
| 16 | hor = 'e'; |
| 17 | } |
| 18 | return ver + hor; |
| 19 | }, |
| 20 | live: true, |
| 21 | html: true, |
| 22 | opacity: 1 |
| 23 | }); |
| 24 | } |
| 25 | }; |
| 26 | }]); |