diff options
Diffstat (limited to 'plugins/Goals/vue/src/GoalPageLink/GoalPageLink.adapter.ts')
-rw-r--r-- | plugins/Goals/vue/src/GoalPageLink/GoalPageLink.adapter.ts | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/plugins/Goals/vue/src/GoalPageLink/GoalPageLink.adapter.ts b/plugins/Goals/vue/src/GoalPageLink/GoalPageLink.adapter.ts new file mode 100644 index 0000000000..5d0948a973 --- /dev/null +++ b/plugins/Goals/vue/src/GoalPageLink/GoalPageLink.adapter.ts @@ -0,0 +1,30 @@ +/*! + * 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, IDirective, IScope } from 'angular'; +import GoalPageLink from './GoalPageLink'; + +export default function piwikGoalPageLink(): IDirective { + return { + restrict: 'A', + link: function expandOnClickLink(scope: IScope, element: JQuery, attrs: IAttributes) { + const binding = { + instance: null, + value: { + idGoal: attrs.piwikGoalPageLink, + }, + oldValue: null, + modifiers: {}, + dir: {}, + }; + + GoalPageLink.mounted(element[0], binding); + }, + }; +} + +window.angular.module('piwikApp').directive('piwikExpandOnClick', piwikGoalPageLink); |