#631 indeed to remove ${} from template
This commit is contained in:
@@ -3,6 +3,11 @@ const template = document.createElement('template');
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
template.innerHTML = `
|
||||
<style>
|
||||
#layersLabel {
|
||||
font-size: 13px;
|
||||
line-height: normal;
|
||||
font-weight: 700;
|
||||
}
|
||||
</style>
|
||||
<div></div>
|
||||
`;
|
||||
@@ -26,7 +31,7 @@ export class SeText extends HTMLElement {
|
||||
* @returns {any} observed
|
||||
*/
|
||||
static get observedAttributes () {
|
||||
return [ 'text', 'value', 'style' ];
|
||||
return [ 'text', 'value', 'style', 'title', 'id' ];
|
||||
}
|
||||
/**
|
||||
* @function attributeChangedCallback
|
||||
@@ -41,9 +46,15 @@ export class SeText extends HTMLElement {
|
||||
case 'text':
|
||||
this.$div.textContent = t(newValue);
|
||||
break;
|
||||
case 'title':
|
||||
this.$div.setAttribute("title", t(newValue));
|
||||
break;
|
||||
case 'style':
|
||||
this.$div.style = newValue;
|
||||
break;
|
||||
case 'id':
|
||||
this.$div.id = newValue;
|
||||
break;
|
||||
case 'value':
|
||||
this.$div.value = newValue;
|
||||
//this.$div.setAttribute("value", newValue);
|
||||
@@ -59,7 +70,7 @@ export class SeText extends HTMLElement {
|
||||
* @returns {any}
|
||||
*/
|
||||
get text () {
|
||||
return this.getAttribute('text');
|
||||
return this.$div.textContent;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,7 +78,7 @@ export class SeText extends HTMLElement {
|
||||
* @returns {void}
|
||||
*/
|
||||
set text (value) {
|
||||
this.setAttribute('text', value);
|
||||
this.$div.setAttribute("title", t(value));
|
||||
}
|
||||
/**
|
||||
* @function get
|
||||
@@ -84,7 +95,21 @@ export class SeText extends HTMLElement {
|
||||
set value (value) {
|
||||
this.value = value;
|
||||
}
|
||||
/**
|
||||
* @function get
|
||||
* @returns {any}
|
||||
*/
|
||||
get title () {
|
||||
return this.getAttribute('title');
|
||||
}
|
||||
|
||||
/**
|
||||
* @function set
|
||||
* @returns {void}
|
||||
*/
|
||||
set title (value) {
|
||||
this.setAttribute('title', value);
|
||||
}
|
||||
/**
|
||||
* @function connectedCallback
|
||||
* @returns {void}
|
||||
|
||||
Reference in New Issue
Block a user