From 727c109b75e578e09592416650a99cd7c2edeb20 Mon Sep 17 00:00:00 2001 From: Awilum Date: Tue, 18 Feb 2020 15:50:56 +0300 Subject: [PATCH] feat(admin-plugin): add left navigation dropdown --- .../templates/partials/modules/tippy.html | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/site/plugins/admin/templates/partials/modules/tippy.html b/site/plugins/admin/templates/partials/modules/tippy.html index 53500622..c71fe984 100644 --- a/site/plugins/admin/templates/partials/modules/tippy.html +++ b/site/plugins/admin/templates/partials/modules/tippy.html @@ -12,7 +12,32 @@ }, trigger: 'click', maxWidth: 500, - zIndex: 10, + zIndex: 100, + content(reference) { + return document.getElementById(reference.getAttribute('data-dropdown')).innerHTML; + } + }); + + const left_nav_dropdown = tippy('.js-left-nav-dropdown-btn', { + placement: 'right', + allowHTML: true, + flipOnUpdate: true, + inlinePositioning: true, + interactive: true, + popperOptions: { + positionFixed: true + }, + trigger: 'click', + maxWidth: 500, + zIndex: 100, + onMount(instance) { + $('.navigation__item--flextype-logo').addClass('hidden'); + $('.navigation__item--bars-logo').removeClass('hidden').addClass('block'); + }, + onHidden(instance) { + $('.navigation__item--flextype-logo').removeClass('hidden').addClass('block'); + $('.navigation__item--bars-logo').addClass('hidden'); + }, content(reference) { return document.getElementById(reference.getAttribute('data-dropdown')).innerHTML; }