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

Commit

Permalink
fire core-resize event when opened state completes change
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Jun 24, 2014
1 parent 0cf929e commit c3b1674
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
7 changes: 7 additions & 0 deletions core-collapse.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
<script>

Polymer('core-collapse', {
/**
* Fired when the target element has been resized as a result of the opened
* state changing.
*
* @event core-resize
*/

/**
* The target element.
Expand Down Expand Up @@ -165,6 +171,7 @@
}
this.setTransitionDuration(null);
this.toggleClosedClass(!this.opened);
this.asyncFire('core-resize', null, this.target);
},

toggleClosedClass: function(closed) {
Expand Down
11 changes: 8 additions & 3 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
<link rel="import" href="core-collapse.html">

<style>

body {
overflow: auto;
margin: 8px 24px;
}


.box {
background: #eee;
}
Expand All @@ -27,7 +32,7 @@
</head>
<body unresolved>

<section style="background: blue; width: 800px;">
<section style="background: steelblue;">

<button onclick="document.querySelector('#collapse1').toggle()">toggle collapse</button>

Expand All @@ -37,7 +42,7 @@

</section>

<section style="background: green; width: 800px;">
<section style="background: seagreen;">

<button onclick="document.querySelector('#collapse2').toggle()">toggle collapse</button>

Expand Down

0 comments on commit c3b1674

Please sign in to comment.