Skip to content

Commit

Permalink
Merge pull request #26 from florian-mueller/master
Browse files Browse the repository at this point in the history
progressTarget.firstChild selects newline text
  • Loading branch information
Arkounay authored Nov 24, 2024
2 parents b83b069 + 3a09a20 commit dfb4d62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions assets/dist/media_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function _pathUpdateEventListener2(data) {
}
function _toggleProgress2(show) {
if (show) {
this.progressTarget.firstChild.style.width = '0%';
this.progressTarget.firstElementChild.style.width = '0%';
this.progressTarget.classList.remove('d-none');
} else {
this.progressTarget.classList.add('d-none');
Expand Down Expand Up @@ -259,7 +259,7 @@ function _uploadFiles2(files) {
};
xhr.upload.onprogress = function (event) {
var percent = event.loaded / event.total * 100;
_this4.progressTarget.firstChild.style.width = percent + '%';
_this4.progressTarget.firstElementChild.style.width = percent + '%';
};
xhr.send(data);
}
Expand Down
4 changes: 2 additions & 2 deletions assets/src/media_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default class extends Controller {

#toggleProgress(show) {
if (show) {
this.progressTarget.firstChild.style.width = '0%';
this.progressTarget.firstElementChild.style.width = '0%';
this.progressTarget.classList.remove('d-none');
} else {
this.progressTarget.classList.add('d-none');
Expand Down Expand Up @@ -100,7 +100,7 @@ export default class extends Controller {

xhr.upload.onprogress = (event) => {
const percent = event.loaded / event.total * 100;
this.progressTarget.firstChild.style.width = percent + '%';
this.progressTarget.firstElementChild.style.width = percent + '%';
};

xhr.send(data);
Expand Down

0 comments on commit dfb4d62

Please sign in to comment.