|
580 | 580 | }
|
581 | 581 | }
|
582 | 582 | , onTooltipTemplateUrlChange = function onTooltipTemplateUrlChange(newValue) {
|
583 |
| - /* tslint:disable */ |
584 |
| - console.log('======inside on tooltip url fn'); |
585 | 583 | if (newValue) {
|
586 | 584 |
|
587 |
| - var applyTemplate = function(template) { |
588 |
| - tooltipElement.removeClass('_force-hidden'); //see lines below, this forces to hide tooltip when is empty |
589 |
| - tipTipElement.empty(); |
590 |
| - tipTipElement.append(closeButtonElement); |
591 |
| - tipTipElement.append($compile(response.data)(scope)); |
592 |
| - $timeout(function doLater() { |
593 |
| - onTooltipShow(); |
594 |
| - }); |
595 |
| - } |
596 |
| - |
597 | 585 | $http.get(newValue).then(function onResponse(response) {
|
598 |
| - if (response && response.data) { |
599 |
| - var template = $templateCache.put(newValue, response.data); |
600 |
| - applyTemplate(template); |
| 586 | + |
| 587 | + if (response && |
| 588 | + response.data) { |
| 589 | + |
| 590 | + tooltipElement.removeClass('_force-hidden'); //see lines below, this forces to hide tooltip when is empty |
| 591 | + tipTipElement.empty(); |
| 592 | + tipTipElement.append(closeButtonElement); |
| 593 | + tipTipElement.append($compile(response.data)(scope)); |
| 594 | + $timeout(function doLater() { |
| 595 | + |
| 596 | + onTooltipShow(); |
| 597 | + }); |
601 | 598 | }
|
602 | 599 | });
|
603 |
| - |
604 | 600 | } else {
|
605 | 601 | //hide tooltip because is empty
|
606 | 602 | tipTipElement.empty();
|
607 | 603 | tooltipElement.addClass('_force-hidden'); //force to be hidden if empty
|
608 | 604 | }
|
609 | 605 | }
|
610 |
| - |
611 | 606 | , onTooltipTemplateUrlCacheChange = function onTooltipTemplateUrlCacheChange(newValue) {
|
612 |
| - |
613 |
| - console.log('SUCCESS!!! === inside on tooltip cache change function'); |
614 | 607 | if (newValue) {
|
615 | 608 |
|
616 | 609 | var applyTemplate = function(template) {
|
|
625 | 618 |
|
626 | 619 | if ($attrs.tooltipTemplateUrl) {
|
627 | 620 | var template = $templateCache.get($attrs.tooltipTemplateUrl);
|
628 |
| - console.log('template is .... ', template); |
629 | 621 |
|
630 | 622 | if (typeof template !== 'undefined') {
|
631 | 623 | applyTemplate(cachedTemplate)
|
632 | 624 | return;
|
633 | 625 | }
|
634 |
| - |
635 | 626 | } else {
|
636 | 627 | //hide tooltip because is empty
|
637 | 628 | tipTipElement.empty();
|
638 | 629 | tooltipElement.addClass('_force-hidden'); //force to be hidden if empty
|
639 | 630 | }
|
640 | 631 | }
|
641 |
| - |
642 | 632 | , onTooltipSideChange = function onTooltipSideChange(newValue) {
|
643 | 633 |
|
644 | 634 | if (newValue) {
|
|
841 | 831 | 'priority': 1,
|
842 | 832 | 'terminal': true,
|
843 | 833 | 'link': linkingFunction
|
844 |
| - }; |
| 834 | + }); |
845 | 835 | }];
|
846 | 836 |
|
847 | 837 | angular.module('720kb.tooltips', [])
|
|
0 commit comments