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

Commit

Permalink
Merge pull request #58 from PolymerElements/code-yellow-perf
Browse files Browse the repository at this point in the history
Fixes #48
  • Loading branch information
cdata committed Oct 8, 2015
2 parents 1c67cff + 0aba83e commit 1fd65e4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 34 deletions.
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
}

paper-button[toggles] {
transition: background-color 0.3s;
transition: all 0.3s;
}

paper-button[toggles][active] {
Expand Down
39 changes: 7 additions & 32 deletions paper-button.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@
-->

<dom-module id="paper-button">
<template>
<template strip-whitespace>

<style>
<style include="paper-material">
:host {
display: inline-block;
position: relative;
Expand All @@ -101,12 +101,12 @@
@apply(--paper-button);
}

:host([raised]) .keyboard-focus {
:host([raised].keyboard-focus) {
font-weight: bold;
@apply(--paper-button-raised-keyboard-focus);
}

:host(:not([raised])) .keyboard-focus {
:host(:not([raised]).keyboard-focus) {
font-weight: bold;
@apply(--paper-button-flat-keyboard-focus);
}
Expand All @@ -120,32 +120,15 @@
@apply(--paper-button-disabled);
}

:host([noink]) paper-ripple {
display: none;
}

paper-ripple {
color: var(--paper-button-ink-color);
}

paper-material {
border-radius: inherit;
@apply(--layout-fit);
}

.content > ::content * {
:host > ::content * {
text-transform: inherit;
}
</style>

<paper-ripple></paper-ripple>

<paper-material elevation="[[_elevation]]" animated></paper-material>

<div class$="[[_computeContentClass(receivedFocusFromKeyboard)]]">
<content></content>
</div>

<content></content>
</template>
</dom-module>

Expand All @@ -171,18 +154,10 @@

_calculateElevation: function() {
if (!this.raised) {
this._elevation = 0;
this.elevation = 0;
} else {
Polymer.PaperButtonBehaviorImpl._calculateElevation.apply(this);
}
},

_computeContentClass: function(receivedFocusFromKeyboard) {
var className = 'content ';
if (receivedFocusFromKeyboard) {
className += ' keyboard-focus';
}
return className;
}
});
</script>
2 changes: 1 addition & 1 deletion test/paper-button.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

Polymer.Base.async(function() {
try {
expect(button._elevation).to.be.eql(1);
expect(button.elevation).to.be.eql(1);
done();
} catch (e) {
done(e);
Expand Down

0 comments on commit 1fd65e4

Please sign in to comment.