Improve media-tag export in pad to work with existing CSP

This commit is contained in:
yflory committed 2017-10-23 10:55:40 +02:00
1 parent 3e4faf1be1
commit c1d05a00ba
3 files changed
+19 -5

No files matched your search

+5 -3
View File
@@ -477,9 +477,11 @@ define([
var exportMediaTags = function (inner, cb) {
var $clone = $(inner).clone();
nThen(function (waitFor) {
$clone.find('media-tag > img').each(function (i, el) {
Util.blobURLToImage($(el).attr('src'), waitFor(function (imgSrc) {
$(el).attr('src', imgSrc);
$(inner).find('media-tag').each(function (i, el) {
if (!$(el).data('blob')) { return; }
Util.blobToImage($(el).data('blob'), waitFor(function (imgSrc) {
$clone.find('media-tag[src="' + $(el).attr('src') + '"] img')
.attr('src', imgSrc);
}));
});
}).nThen(function () {