2 Polymer('paper-button', {
7 * The label of the button.
16 * If true, the button will be styled as a "raised" button.
18 * @attribute raisedButton
22 raisedButton: {value: false, reflect: true},
25 * (optional) The URL of an image for an icon to use in the button.
26 * Should not use `icon` property if you are using this property.
35 * (optional) Specifies the icon name or index in the set of icons
36 * available in the icon set. If using this property, load the icon
37 * set separately where the icon is used. Should not use `src`
38 * if you are using this property.
50 attached: function() {
51 if (this.textContent && !this.textContent.match(/\s+/)) {
52 console.warn('Using textContent to label the button is deprecated. Use the "label" property instead');
53 this.label = this.textContent;
57 activeChanged: function() {
61 // FIXME: remove when paper-ripple can have a default 'down' state.
62 if (!this.lastEvent) {
63 var rect = this.getBoundingClientRect();
65 x: rect.left + rect.width / 2,
66 y: rect.top + rect.height / 2
69 this.$.ripple.downAction(this.lastEvent);
71 this.$.ripple.upAction();
76 focusedChanged: function() {
81 disabledChanged: function() {
86 // waitForSpillCompleted: function(callback) {
87 // this.async(callback, null, (this.$.ink.spillCompleted ? 0 : this.duration));
90 // resetInk: function() {
91 // this.active = false;
92 // this.$.ink.reset();
95 insideButton: function(x, y) {
96 var rect = this.getBoundingClientRect();
97 return (rect.left <= x) && (x <= rect.right) && (rect.top <= y) && (y <= rect.bottom);
100 adjustZ: function() {
102 this.classList.add('paper-shadow-animate-z-1-z-2');
104 this.classList.remove('paper-shadow-animate-z-1-z-2');
108 } else if (this.disabled) {
117 downAction: function(e) {
122 labelChanged: function() {
123 this.setAttribute('aria-label', this.label);