Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
set elevation like the read-only property it is
Browse files Browse the repository at this point in the history
  • Loading branch information
notwaldorf committed Dec 9, 2015
1 parent 53d8338 commit b65955e
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);

This comment has been minimized.

Copy link
@davidmaxwaterman

davidmaxwaterman Dec 21, 2015

Is there a reason that elevation is readonly? The docs for paper-fab, and even the comment in paper-behavior suggest it is settable by the user.

} 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 b65955e

Please sign in to comment.