Convert legacy Polyemer elements to class-based
This commit converts almost all Polymer elements from Polymer-function based components to class-based components. There are few files which should be converted manually after this commit. Change-Id: I9e597e79053e0a6b5d5c0f1b54676d11b9d81db7
This commit is contained in:
@@ -17,23 +17,29 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
Polymer({
|
||||
is: 'gr-tooltip',
|
||||
class GrTooltip extends Polymer.GestureEventListeners(
|
||||
Polymer.LegacyElementMixin(
|
||||
Polymer.Element)) {
|
||||
static get is() { return 'gr-tooltip'; }
|
||||
|
||||
properties: {
|
||||
text: String,
|
||||
maxWidth: {
|
||||
type: String,
|
||||
observer: '_updateWidth',
|
||||
},
|
||||
positionBelow: {
|
||||
type: Boolean,
|
||||
reflectToAttribute: true,
|
||||
},
|
||||
},
|
||||
static get properties() {
|
||||
return {
|
||||
text: String,
|
||||
maxWidth: {
|
||||
type: String,
|
||||
observer: '_updateWidth',
|
||||
},
|
||||
positionBelow: {
|
||||
type: Boolean,
|
||||
reflectToAttribute: true,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
_updateWidth(maxWidth) {
|
||||
this.updateStyles({'--tooltip-max-width': maxWidth});
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define(GrTooltip.is, GrTooltip);
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user