material 0.8.8 → 0.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/button.js +12 -3
package/package.json
CHANGED
package/src/button.js
CHANGED
|
@@ -82,8 +82,7 @@ class Button extends EventEmitter {
|
|
|
82
82
|
this.element.value = value
|
|
83
83
|
break
|
|
84
84
|
case 'label':
|
|
85
|
-
|
|
86
|
-
this.ui.label.innerHTML = value
|
|
85
|
+
this.setLabel(value)
|
|
87
86
|
break
|
|
88
87
|
case 'text':
|
|
89
88
|
this.element.innerHTML = value
|
|
@@ -126,12 +125,22 @@ class Button extends EventEmitter {
|
|
|
126
125
|
case 'value':
|
|
127
126
|
return this.element.value
|
|
128
127
|
case 'label':
|
|
129
|
-
return this.
|
|
128
|
+
return this.getText()
|
|
129
|
+
case 'text':
|
|
130
|
+
return this.getText()
|
|
130
131
|
default:
|
|
131
132
|
return this.element.value
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
|
|
136
|
+
getText () {
|
|
137
|
+
if (this.ui.label) {
|
|
138
|
+
return this.ui.label.innerHTML
|
|
139
|
+
} else {
|
|
140
|
+
return this.element.innerHTML
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
135
144
|
disable () {
|
|
136
145
|
this.element.disabled = true
|
|
137
146
|
}
|