Skip to content

Commit e2dfce4

Browse files
committed
feat(new-ui): make spinner more visible in gallery view
This was done by making the thumbnail a bit opaque when the spinner is visible. The opacity of the thumbnail is changed via CSS when the file's LI contains a "qq-in-progress" class. The templating module adds this class to the file container when the spinner is shown, and removes it when the spinner is hidden. FineUploader#1297
1 parent d89ea5a commit e2dfce4

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

client/fineuploader-gallery.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
text-align: center;
6262
top: 45%;
6363
opacity: 0.25;
64+
filter: alpha(opacity=25);
6465
}
6566
.qq-gallery .qq-upload-drop-area, .qq-upload-extra-drop-area {
6667
position: absolute;
@@ -397,6 +398,11 @@
397398

398399
/* Thumbnail
399400
------------------------------------------ */
401+
.qq-gallery .qq-in-progress .qq-thumbnail-wrapper {
402+
/* makes the spinner on top of the thumbnail more visible */
403+
opacity: 0.5;
404+
filter: alpha(opacity=50);
405+
}
400406
.qq-gallery .qq-thumbnail-wrapper {
401407
overflow: hidden;
402408
position: relative;

client/js/templating.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ qq.Templating = function(spec) {
1818
// This variable is duplicated in the DnD module since it can function as a standalone as well
1919
HIDE_DROPZONE_ATTR = "qq-hide-dropzone",
2020
DROPZPONE_TEXT_ATTR = "qq-drop-area-text",
21+
IN_PROGRESS_CLASS = "qq-in-progress",
2122
isCancelDisabled = false,
2223
generatedThumbnails = 0,
2324
thumbnailQueueMonitorRunning = false,
@@ -938,10 +939,12 @@ qq.Templating = function(spec) {
938939
},
939940

940941
hideSpinner: function(id) {
942+
qq(getFile(id)).removeClass(IN_PROGRESS_CLASS);
941943
hide(getSpinner(id));
942944
},
943945

944946
showSpinner: function(id) {
947+
qq(getFile(id)).addClass(IN_PROGRESS_CLASS);
945948
show(getSpinner(id));
946949
},
947950

client/js/uploader.api.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@
365365
}
366366
else {
367367
qq(fileContainer).addClass(self._classes.fail);
368+
templating.showCancel(id);
368369

369370
if (templating.isRetryPossible() && !self._preventRetries[id]) {
370371
qq(fileContainer).addClass(self._classes.retryable);

test/unit/templating.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,11 @@ describe("templating.js", function() {
175175
it("hides and shows spinner", function() {
176176
templating.hideSpinner(0);
177177
assert.ok($(fileContainer0).find(".qq-upload-spinner-selector").hasClass(HIDE_CSS));
178+
assert.ok(!$(fileContainer0).hasClass("qq-in-progress"));
178179

179180
templating.showSpinner(0);
180181
assert.ok(!$(fileContainer0).find(".qq-upload-spinner-selector").hasClass(HIDE_CSS));
182+
assert.ok($(fileContainer0).hasClass("qq-in-progress"));
181183
});
182184

183185
it("updates status text", function() {

0 commit comments

Comments
 (0)