Skip to content

Instantly share code, notes, and snippets.

@garlicnation
Created December 7, 2015 22:29
Show Gist options
  • Save garlicnation/9751613b3828c2288232 to your computer and use it in GitHub Desktop.
Save garlicnation/9751613b3828c2288232 to your computer and use it in GitHub Desktop.
Polymer.fc = {
properties: {
_elevation: {
type: Number
}
},
observers: ["_calculateElevation(focused, disabled, active, pressed, receivedFocusFromKeyboard)"],
hostAttributes: {
role: "button",
tabindex: "0"
},
nc: function() {
var a = 1;
this.disabled ? a = 0 : this.active || this.pressed ? a = 4 : this.receivedFocusFromKeyboard && (a = 3);
this._elevation = a
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment