Yeah I would love to know. That was my initial approach,  but didn't find out. Thanks a lot for the review. I ll answer to all of that tomorrow.  ;)


Envoyé depuis un mobile Samsung

-------- Message d'origine --------
De : Gilbert Jeiziner <notifications@github.com> 
Date :  
A : geoadmin/mf-geoadmin3 <mf-geoadmin3@noreply.github.com> 
Cc : loicgasser <loicgasser4@gmail.com> 
Objet : Re: [mf-geoadmin3] Centralize legend getter in a service (#277) 
 
In src/components/search/SearchDirective.js:

>                var viewDropDown = $(taElt).data('ttView').dropdownView;
>                viewDropDown.on('suggestionsRendered', function(event) {
> -                // Only for layer search at the moment
> -                var elements = angular.element('.tt-dataset-layers');
> -                $compile(elements)(scope);
> +                // Only compile when the suggestions are finally visible
> +                if (this.isVisible()) {
> +                  // Make sure the final html content is compiled once only
> +                  if (finalRequest) {
> +                    // Only for layer search at the moment
> +                    var elements = element.find('.tt-dataset-layers');
> +                    $compile(elements)(scope);
> +                    finalRequest = false;
> +                  } else {
> +                    finalRequest = true;
> +                  }
> +                }
Maybe there is a way to find out if an element has been compiled already directly on the element, or the is an angular way to find out?

—
Reply to this email directly or view it on GitHub.