Added placeholder support to editable-label. Implemented a chip list with chips and search/edit functionality. Added a simple popper class to help with pop overs.
This commit is contained in:
@@ -31,6 +31,11 @@ class EditableLabel extends IgniteElement {
|
||||
padding: 0.2rem;
|
||||
}
|
||||
|
||||
mt-editable-label>div:empty:before {
|
||||
content: attr(data-placeholder);
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
mt-editable-label>button {
|
||||
margin-left: 0.5em;
|
||||
background-color: #2196F3;
|
||||
@@ -57,7 +62,8 @@ class EditableLabel extends IgniteElement {
|
||||
editOnClick: true,
|
||||
multiLine: false,
|
||||
saveButton: true,
|
||||
input: null
|
||||
input: null,
|
||||
placeholder: null
|
||||
};
|
||||
}
|
||||
|
||||
@@ -68,6 +74,7 @@ class EditableLabel extends IgniteElement {
|
||||
.innerHTML(this.value)
|
||||
.class(this.editing, (value) => { return value ? "focus" : null; })
|
||||
.attribute("contenteditable", this.editing)
|
||||
.data("placeholder", this.placeholder)
|
||||
.ref(this.input)
|
||||
.onClick(() => this.onClick())
|
||||
.onBlur(() => this.onBlur())
|
||||
@@ -84,7 +91,6 @@ class EditableLabel extends IgniteElement {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onClick() {
|
||||
@@ -101,7 +107,6 @@ class EditableLabel extends IgniteElement {
|
||||
if (this.input.innerHTML !== this.value) {
|
||||
this.value = this.input.innerHTML;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user