diff --git a/assets/styles/main.scss b/assets/styles/main.scss index e9254c4b9..91b040f54 100644 --- a/assets/styles/main.scss +++ b/assets/styles/main.scss @@ -126,3 +126,23 @@ hr { background-color: $color-neutral-80; height: 1px !important; } + +#overlay { + display: block; + opacity: 0; + width: 100%; + height: 100%; + top: 0; + left: 0; + position: fixed; + background: rgba(0, 0, 0, 0.15); + z-index: 99; + pointer-events: none; + transition: opacity 150ms ease-out; + transition-delay: 50ms; + + .dropdown-open & { + opacity: 1; + transition-delay: 0; + } +} diff --git a/components/Author.vue b/components/Author.vue index 4ad1e6583..377b74b7f 100644 --- a/components/Author.vue +++ b/components/Author.vue @@ -1,127 +1,127 @@ + + @@ -191,4 +166,15 @@ export default { margin-top: -45px; border: #fff 5px solid; } +.author { + white-space: nowrap; + position: relative; + display: flex; + align-items: center; + + &:hover, + &.active { + z-index: 999; + } +} diff --git a/components/Dropdown.vue b/components/Dropdown.vue index f47c1cabb..1cfe84c2b 100644 --- a/components/Dropdown.vue +++ b/components/Dropdown.vue @@ -3,10 +3,16 @@ :open.sync="isPopoverOpen" :open-group="Math.random().toString()" :placement="placement" + :disabled="disabled" trigger="manual" :offset="offset" > - +
@@ -29,6 +38,7 @@ let mouseLeaveTimer = null export default { props: { placement: { type: String, default: 'bottom-end' }, + disabled: { type: Boolean, default: false }, offset: { type: [String, Number], default: '16' } }, data() { @@ -36,17 +46,68 @@ export default { isPopoverOpen: false } }, + computed: { + isOpen() { + return this.isPopoverOpen + } + }, + watch: { + isPopoverOpen: { + immediate: true, + handler(isOpen) { + try { + if (isOpen) { + this.$nextTick(() => { + setTimeout(() => { + document + .getElementsByTagName('body')[0] + .classList.add('dropdown-open') + }, 20) + }) + } else { + document + .getElementsByTagName('body')[0] + .classList.remove('dropdown-open') + } + } catch (err) {} + } + } + }, beforeDestroy() { clearTimeout(mouseEnterTimer) clearTimeout(mouseLeaveTimer) }, methods: { toggleMenu() { - this.isPopoverOpen = !this.isPopoverOpen + this.isPopoverOpen ? this.closeMenu(false) : this.openMenu(false) + }, + openMenu(useTimeout) { + if (this.disabled) { + return + } + this.clearTimeouts() + if (useTimeout === true) { + this.popoverMouseEnter() + } else { + this.isPopoverOpen = true + } + }, + closeMenu(useTimeout) { + if (this.disabled) { + return + } + this.clearTimeouts() + if (useTimeout === true) { + this.popoveMouseLeave() + } else { + this.isPopoverOpen = false + } }, popoverMouseEnter() { - clearTimeout(mouseEnterTimer) - clearTimeout(mouseLeaveTimer) + if (this.disabled) { + return + } + this.clearTimeouts() if (!this.isPopoverOpen) { mouseEnterTimer = setTimeout(() => { this.isPopoverOpen = true @@ -54,13 +115,19 @@ export default { } }, popoveMouseLeave() { - clearTimeout(mouseEnterTimer) - clearTimeout(mouseLeaveTimer) + if (this.disabled) { + return + } + this.clearTimeouts() if (this.isPopoverOpen) { mouseLeaveTimer = setTimeout(() => { this.isPopoverOpen = false }, 300) } + }, + clearTimeouts() { + clearTimeout(mouseEnterTimer) + clearTimeout(mouseLeaveTimer) } } } diff --git a/layouts/blank.vue b/layouts/blank.vue index 23a783ac6..140ec9f6e 100644 --- a/layouts/blank.vue +++ b/layouts/blank.vue @@ -5,6 +5,7 @@ +
diff --git a/layouts/default.vue b/layouts/default.vue index 6bf42691e..f79b00db5 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -26,7 +26,7 @@ @@ -121,6 +125,10 @@ export default { }, methods: { isExact(url) { + if (url.indexOf('/profile') === 0) { + // do only match own profile + this.$route.path === url + } return this.$route.path.indexOf(url) === 0 } } @@ -147,10 +155,14 @@ export default { padding-bottom: 0.5rem; nav { - margin-left: -15px; - margin-right: -15px; + margin-left: -16px; + margin-right: -10px; padding-top: 1rem; padding-bottom: 1rem; + + a { + padding-left: 12px; + } } } diff --git a/styleguide/src/system/components/navigation/Menu/MenuItem.vue b/styleguide/src/system/components/navigation/Menu/MenuItem.vue index 83ce8fa2c..0926d0803 100644 --- a/styleguide/src/system/components/navigation/Menu/MenuItem.vue +++ b/styleguide/src/system/components/navigation/Menu/MenuItem.vue @@ -14,6 +14,10 @@