Skip to content

Commit

Permalink
Merge pull request #80 from PolymerElements/fix-raised
Browse files Browse the repository at this point in the history
set elevation like the read-only property it is
  • Loading branch information
notwaldorf committed Dec 9, 2015
2 parents 53d8338 + b65955e commit f2a3c2c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion paper-button.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@

_calculateElevation: function() {
if (!this.raised) {
this.elevation = 0;
this._setElevation(0);
} else {
Polymer.PaperButtonBehaviorImpl._calculateElevation.apply(this);
}
Expand Down
18 changes: 17 additions & 1 deletion test/paper-button.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<script src="../../iron-test-helpers/mock-interactions.js"></script>

<link rel="import" href="../paper-button.html">

</head>
<body>

Expand Down Expand Up @@ -52,6 +52,22 @@
}, 1);
});

test('can be unraised after being raised imperatively', function(done) {
button.raised = true;
expect(button.hasAttribute('raised')).to.be.eql(true);

Polymer.Base.async(function() {
expect(button.elevation).to.be.eql(1);

button.raised = false;
expect(button.hasAttribute('raised')).to.be.eql(false);
Polymer.Base.async(function() {
expect(button.elevation).to.be.eql(0);
done();
}, 1);
}, 1);
});

test('can be disabled imperatively', function() {
button.disabled = true;
expect(button.getAttribute('aria-disabled')).to.be.eql('true');
Expand Down

0 comments on commit f2a3c2c

Please sign in to comment.