clear up; add demo data
This commit is contained in:
@@ -9,6 +9,7 @@ export default class extends Controller {
|
||||
step: { type: Number, default: 1 },
|
||||
hash: { type: String, default: '' },
|
||||
showUrl: {type: String, default: null },
|
||||
demo: { type: Boolean, default: false },
|
||||
};
|
||||
|
||||
connect() {
|
||||
@@ -81,7 +82,8 @@ export default class extends Controller {
|
||||
}
|
||||
|
||||
async submit() {
|
||||
if (this.files.length === 0) {
|
||||
console.log(this.demoValue)
|
||||
if (this.files.length === 0 && !this.demoValue) {
|
||||
this.openPicker();
|
||||
return;
|
||||
}
|
||||
@@ -143,7 +145,7 @@ export default class extends Controller {
|
||||
}
|
||||
|
||||
updateChips() {
|
||||
const has = this.files.length > 0;
|
||||
const has = this.files.length > 0 || this.demoValue;
|
||||
this.chipsTarget.hidden = !has;
|
||||
this.addMoreTarget.hidden = !has;
|
||||
this.chipsTarget.innerHTML = this.files
|
||||
|
||||
@@ -108,6 +108,10 @@
|
||||
transition: all .15s;
|
||||
cursor: pointer;
|
||||
font-family: inherit;
|
||||
&.unable {
|
||||
opacity: 0.2;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
&[data-accent="div"]:hover {
|
||||
border-color: #3F8F6B;
|
||||
|
||||
Reference in New Issue
Block a user