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

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/CoreHome/vue/src/DropdownMenu/DropdownMenu.adapter.ts')
-rw-r--r--plugins/CoreHome/vue/src/DropdownMenu/DropdownMenu.adapter.ts34
1 files changed, 34 insertions, 0 deletions
diff --git a/plugins/CoreHome/vue/src/DropdownMenu/DropdownMenu.adapter.ts b/plugins/CoreHome/vue/src/DropdownMenu/DropdownMenu.adapter.ts
new file mode 100644
index 0000000000..1e8598881a
--- /dev/null
+++ b/plugins/CoreHome/vue/src/DropdownMenu/DropdownMenu.adapter.ts
@@ -0,0 +1,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 { IDirective } from 'angular';
+import DropdownMenu from './DropdownMenu';
+
+function piwikDropdownMenu($timeout): IDirective {
+ return {
+ restrict: 'A',
+ link: function piwikDropdownMenuLink(scope, element, attrs) {
+ const binding = {
+ instance: null,
+ value: {
+ activates: $(`#${attrs.activates}`)[0],
+ },
+ oldValue: null,
+ modifiers: {},
+ dir: {},
+ };
+
+ $timeout(() => {
+ DropdownMenu.mounted(element[0], binding);
+ });
+ },
+ };
+}
+
+piwikDropdownMenu.$inject = ['$timeout'];
+
+angular.module('piwikApp').directive('piwikDropdownMenu', piwikDropdownMenu);