Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
add openDrawer() and closeDrawer(); apply transition class after ready
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiefu committed Apr 28, 2014
1 parent 24d599f commit 9483253
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core-drawer-panel.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
height: 100%;
box-sizing: border-box;
-mox-box-sizing: border-box;
}

:host(.core-panel-transition) #drawer {
transition: -webkit-transform ease-in-out 0.3s, width ease-in-out 0.3s;
transition: transform ease-in-out 0.3s, width ease-in-out 0.3s;
}
Expand Down Expand Up @@ -58,6 +61,9 @@ right-drawer: make drawer on the right side
bottom: 0;
left: 256px;
overflow: auto;
}

:host(.core-panel-transition) #main {
transition: left ease-in-out 0.3s, padding ease-in-out 0.3s;
}

Expand Down
14 changes: 14 additions & 0 deletions core-drawer-panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,24 @@
*/
narrow: {value: false, reflect: true}
},

ready: function() {
this.async(function() {
this.classList.add('core-panel-transition');
});
},

togglePanel: function() {
this.selected = this.selected === 'main' ? 'drawer' : 'main';
},

openDrawer: function() {
this.selected = 'drawer';
},

closeDrawer: function() {
this.selected = 'main';
},

queryMatchesChanged: function() {
if (this.queryMatches) {
Expand Down

0 comments on commit 9483253

Please sign in to comment.