Handle cached mediatags in preview modal

pull/1/head
yflory 4 years ago
parent 43ad4f0a84
commit 7b4a89be92

@ -66,6 +66,9 @@
.mediatag_cryptpad() { .mediatag_cryptpad() {
media-tag { media-tag {
&:empty {
display: none !important;
}
cursor: pointer; cursor: pointer;
* { * {
max-width: 100%; max-width: 100%;

@ -249,7 +249,6 @@ define([
var locked = false; var locked = false;
var show = function (_i) { var show = function (_i) {
if (locked) { return; } if (locked) { return; }
locked = true;
if (_i < 0) { i = 0; } if (_i < 0) { i = 0; }
else if (_i > tags.length -1) { i = tags.length - 1; } else if (_i > tags.length -1) { i = tags.length - 1; }
else { i = _i; } else { i = _i; }
@ -293,7 +292,6 @@ define([
if (_key) { key = 'cryptpad:' + Nacl.util.encodeBase64(_key); } if (_key) { key = 'cryptpad:' + Nacl.util.encodeBase64(_key); }
} }
if (!src || !key) { if (!src || !key) {
locked = false;
$spinner.hide(); $spinner.hide();
return void UI.log(Messages.error); return void UI.log(Messages.error);
} }
@ -307,13 +305,18 @@ define([
locked = false; locked = false;
$spinner.hide(); $spinner.hide();
UI.log(Messages.error); UI.log(Messages.error);
}).on('progress', function () {
$spinner.hide();
locked = true;
}).on('complete', function () {
locked = false;
$spinner.hide();
}); });
}); });
} }
var observer = new MutationObserver(function(mutations) { var observer = new MutationObserver(function(mutations) {
mutations.forEach(function() { mutations.forEach(function() {
locked = false;
$spinner.hide(); $spinner.hide();
}); });
}); });

Loading…
Cancel
Save