diff --git a/docs/src/pages/components/Menu.vue b/docs/src/pages/components/Menu.vue index 766f770..4cc4237 100644 --- a/docs/src/pages/components/Menu.vue +++ b/docs/src/pages/components/Menu.vue @@ -13,6 +13,42 @@ My Item 3 + + + + more_vert + + + + My Item 1 + My Item 2 + My Item 3 + + + + + + more_vert + + + + My Item 1 + My Item 2 + My Item 3 + + + + + + more_vert + + + + My Item 1 + My Item 2 + My Item 3 + + @@ -25,3 +61,9 @@ + + diff --git a/package.json b/package.json index d2381a4..c7ffc12 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "autosize": "^3.0.17", "element.scrollintoviewifneeded-polyfill": "^1.0.1", "scopedQuerySelectorShim": "github:lazd/scopedQuerySelectorShim", + "transitionEnd": "^1.0.2", "vue": "^2.0.2" }, "devDependencies": { diff --git a/src/components/mdMenu/mdMenu.scss b/src/components/mdMenu/mdMenu.scss index 09a99e5..83cc92b 100644 --- a/src/components/mdMenu/mdMenu.scss +++ b/src/components/mdMenu/mdMenu.scss @@ -2,9 +2,14 @@ $menu-base-width: 56px; +.md-menu { + display: inline-block; +} + .md-menu-content { + width: $menu-base-width * 3; min-width: $menu-base-width * 1.5; - max-width: $menu-base-width * 3; + max-width: $menu-base-width * 7; min-height: 64px; max-height: 256px; padding: 8px 0; @@ -23,44 +28,41 @@ $menu-base-width: 56px; border-radius: 2px; box-shadow: $material-shadow-2dp; opacity: 0; - transform: scale3D(.85, .7, 1); - transition: $swift-ease-out-duration $swift-ease-out-timing-function, - opacity .25s $swift-ease-in-timing-function, - top .25s $swift-ease-in-timing-function, - transform 0s .25s $swift-ease-in-timing-function; + transform: scale3D(.85, .85, 1); + transition: width $swift-ease-out-duration $swift-ease-out-timing-function, + opacity .2s $swift-ease-in-timing-function, + transform .15s .1s $swift-ease-in-timing-function; color: rgba(#212121, .87); &.md-active { pointer-events: auto; opacity: 1; transform: scale3D(1, 1, 1); - transform-origin: center top; - transition: $swift-ease-out; - transition-duration: .25s; - transition-property: opacity, transform, top; + transform-origin: center; + transition: width $swift-ease-out-duration $swift-ease-out-timing-function, + opacity .2s $swift-ease-out-timing-function, + transform .15s .1s $swift-ease-out-timing-function; > * { opacity: 1; transition: $swift-ease-in; - transition-duration: .15s; - transition-delay: .1s; } } &.md-size-1 { - max-width: $menu-base-width * 1.5; + width: $menu-base-width * 1.5; } @for $i from 2 through 7 { &.md-size-#{$i} { - max-width: $menu-base-width * $i; + width: $menu-base-width * $i; } } > * { opacity: 0; transition: $swift-ease-out; - transition-duration: .25s; + transition-duration: .3s; } } @@ -83,6 +85,7 @@ $menu-base-width: 56px; &:hover { background-color: rgba(#000, .12); + transition: $swift-ease-out; } .md-menu-item-content { diff --git a/src/components/mdMenu/mdMenu.vue b/src/components/mdMenu/mdMenu.vue index dd80364..5348c02 100644 --- a/src/components/mdMenu/mdMenu.vue +++ b/src/components/mdMenu/mdMenu.vue @@ -7,11 +7,19 @@