Welcome to mirror list, hosted at ThFree Co, Russian Federation.

widgetContainer.twig « templates « CoreHome « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 06121d1ebac8273d45b0ff6ccd8efce6171bb1bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<div>
    <div piwik-widget
         containerid="{{ containerId|e('html_attr') }}"
         widgetized="{% if isWidgetized %}true{% else %}false{% endif %}"></div>

    <script type="text/javascript">
        $(function () {

            var piwikWidget = $('[piwik-widget][containerid={{ containerId|e('js') }}]');
            var isExportedAsWidget = $('body > .widget').size();

            if (!isExportedAsWidget) {
                angular.element(document).injector().invoke(function($compile) {
                    var scope = angular.element(piwikWidget).scope();
                    $compile(piwikWidget)(scope.$new());
                });
            }

        });
    </script>
</div>