From f8edaffc7fe92e7cc773ee1e57bdfbf2f217af7d Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Sun, 9 Dec 2018 23:25:26 +0300 Subject: [PATCH] Toggleable Panel --- src/components/panel/Panel.css | 27 ++++++++++++++++++--------- src/components/panel/Panel.vue | 28 ++++++++++++++++++++++------ src/views/panel/PanelDemo.vue | 4 +++- 3 files changed, 43 insertions(+), 16 deletions(-) diff --git a/src/components/panel/Panel.css b/src/components/panel/Panel.css index 37cfe5374..662537c05 100644 --- a/src/components/panel/Panel.css +++ b/src/components/panel/Panel.css @@ -13,11 +13,15 @@ width: 1.25em; line-height: 1.25em; text-align: center; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -o-user-select: none; + user-select: none; } .p-panel .p-panel-titlebar-icon span { line-height: inherit; - margin-top: -1px; } .p-panel .p-panel-content { @@ -32,17 +36,22 @@ text-align:left; } -.p-panel-content-wrapper-collapsed { - overflow: hidden; +.p-panel-content-wrapper-enter, +.p-panel-content-wrapper-leave-to { max-height: 0; +} + +.p-panel-content-wrapper-enter-to, +.p-panel-content-wrapper-leave { + max-height: 1000px; +} + +.p-panel-content-wrapper-leave-active { + overflow: hidden; transition: max-height 0.5s cubic-bezier(0, 1, 0, 1); } -.p-panel-content-wrapper-expanded { - max-height: 1000px; - transition: max-height 1s ease-in-out; -} - -.p-panel-content-wrapper-expanding { +.p-panel-content-wrapper-enter-active { overflow: hidden; + transition: max-height 1s ease-in-out; } \ No newline at end of file diff --git a/src/components/panel/Panel.vue b/src/components/panel/Panel.vue index 17b52170e..9c9d6623a 100644 --- a/src/components/panel/Panel.vue +++ b/src/components/panel/Panel.vue @@ -4,12 +4,17 @@ {{header}} + + + -
-
- + +
+
+ +
-
+
@@ -17,8 +22,19 @@ export default { props: { header: String, - toggleable: Boolean - } + toggleable: Boolean, + collapsed: Boolean + }, + data() { + return { + d_collapsed: this.collapsed + } + }, + methods: { + toggle() { + this.d_collapsed = !this.d_collapsed; + } + } } diff --git a/src/views/panel/PanelDemo.vue b/src/views/panel/PanelDemo.vue index 85a4beb85..11aa59456 100644 --- a/src/views/panel/PanelDemo.vue +++ b/src/views/panel/PanelDemo.vue @@ -8,6 +8,7 @@
+

Regular

The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding. His beloved son Michael has just come home from the war, but does not intend to become part of his father's business. @@ -15,7 +16,8 @@ kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family. - +

Toggleable

+ The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding. His beloved son Michael has just come home from the war, but does not intend to become part of his father's business. Through Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family,