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

PluginName.adapter.ts « PluginName « src « vue « Marketplace « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1259800d45478b698efc82b9a5d1b3c90470c465 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */

import { IAttributes, IScope } from 'angular';
import PluginName from './PluginName';

function piwikPluginName() {
  return {
    restrict: 'A',
    link(scope: IScope, element: JQuery, attrs: IAttributes) {
      const binding = {
        instance: null,
        value: {
          pluginName: attrs.piwikPluginName,
          activePluginTab: attrs.activeplugintab,
        },
        oldValue: null,
        modifiers: {},
        dir: {},
      };

      PluginName.mounted(element[0], binding);
      element.on('$destroy', () => {
        PluginName.unmounted(element[0], binding);
      });
    },
  };
}

window.angular.module('piwikApp').directive('piwikPluginName', piwikPluginName);