Skip to content

Commit

Permalink
Add max_items, selected, multiple and include_blank.
Browse files Browse the repository at this point in the history
Added functionality to select, updated simuluscontroller to listen to the added data attributes, Updated Trix editor
  • Loading branch information
Thrizian committed Jan 29, 2025
1 parent bc784aa commit 186b8dc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 29 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ gemfiles/.bundle/
.yardoc
/doc
*.gem
.aider.*
aider.conf.yml
32 changes: 5 additions & 27 deletions app/assets/builds/administrate/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -14372,47 +14372,25 @@
}
start() {
this.directUpload.create(this.directUploadDidComplete.bind(this));
this.dispatch("start");
}
directUploadWillStoreFileWithXHR(xhr) {
xhr.upload.addEventListener("progress", (event) => {
const progress = event.loaded / event.total * 100;
this.attachment.setUploadProgress(progress);
if (progress) {
this.dispatch("progress", {
progress
});
}
});
}
directUploadDidComplete(error2, attributes) {
if (error2) {
this.dispatchError(error2);
} else {
this.attachment.setAttributes({
sgid: attributes.attachable_sgid,
url: this.createBlobUrl(attributes.signed_id, attributes.filename)
});
this.dispatch("end");
throw new Error(`Direct upload failed: ${error2}`);
}
this.attachment.setAttributes({
sgid: attributes.attachable_sgid,
url: this.createBlobUrl(attributes.signed_id, attributes.filename)
});
}
createBlobUrl(signedId, filename) {
return this.blobUrlTemplate.replace(":signed_id", signedId).replace(":filename", encodeURIComponent(filename));
}
dispatch(name, detail = {}) {
detail.attachment = this.attachment;
return dispatchEvent2(this.element, `direct-upload:${name}`, {
detail
});
}
dispatchError(error2) {
const event = this.dispatch("error", {
error: error2
});
if (!event.defaultPrevented) {
alert(error2);
}
}
get directUploadUrl() {
return this.element.dataset.directUploadUrl;
}
Expand Down
4 changes: 2 additions & 2 deletions spec/example_app/app/views/admin/stats/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div style="padding: 20px">
<h1>Stats</h1>
<br>
<p><b>Total Customers:</b> <%= @stats[:customer_count] %></h1>
<p><b>Total Customers:</b> <%= @stats[:customer_count] %></h1></p>
<br>
<p><b>Total Orders:</b> <%= @stats[:order_count] %></h1>
<p><b>Total Orders:</b> <%= @stats[:order_count] %></h1></p>
</div>

0 comments on commit 186b8dc

Please sign in to comment.