Skip to content

Commit 87c271d

Browse files
Implement createProgressBar and removeProgressBar methods
1 parent 689c33f commit 87c271d

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

build/media_source/com_media/js/edit-images.es6.js

100644100755
Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,34 @@ class Edit {
156156
Redo() { }
157157

158158
// @TODO Create the progress bar
159-
// eslint-disable-next-line class-methods-use-this
160-
createProgressBar() { }
159+
/**
160+
* Creates a progress bar element and inserts it into the DOM
161+
*/
162+
createProgressBar() {
163+
const mediaLoader = document.createElement('div');
164+
mediaLoader.id = 'media-edit-progress';
165+
mediaLoader.className = 'media-loader';
166+
167+
mediaLoader.style.top = '0';
168+
mediaLoader.style.left = '0';
169+
mediaLoader.style.zIndex = '1000';
170+
171+
this.baseContainer.insertAdjacentElement('beforebegin', mediaLoader);
172+
}
161173

162174
// @TODO Update the progress bar
163-
// eslint-disable-next-line class-methods-use-this
164175
updateProgressBar(/* position */) { }
165176

166177
// @TODO Remove the progress bar
167-
// eslint-disable-next-line class-methods-use-this
168-
removeProgressBar() { }
178+
/**
179+
* Removes the progress bar element from the DOM
180+
*/
181+
removeProgressBar() {
182+
const mediaLoader = document.getElementById('media-edit-progress');
183+
if (mediaLoader) {
184+
mediaLoader.remove();
185+
}
186+
}
169187

170188
/**
171189
* Uploads

0 commit comments

Comments
 (0)