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

Commit

Permalink
make sure all transitons are done for expand before doing contract
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiefu committed Aug 18, 2014
1 parent dacf7c3 commit 4c42c4b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions paper-tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,18 @@
this.$.selectionBar.classList.add('expand');
if (old < this.selectedIndex) {
s.width = w + w * (this.selectedIndex - old) - m + '%';
this._transitionCounter = 1;
} else {
s.width = w + w * (old - this.selectedIndex) - m + '%';
s.left = this.selectedIndex * w + m + '%';
this._transitionCounter = 2;
}
},

barTransitionEnd: function() {
barTransitionEnd: function(e) {
this._transitionCounter--;
var cl = this.$.selectionBar.classList;
if (cl.contains('expand')) {
if (cl.contains('expand') && !this._transitionCounter) {
cl.remove('expand');
cl.add('contract');
var s = this.$.selectionBar.style;
Expand Down

0 comments on commit 4c42c4b

Please sign in to comment.