Fix mediatags in pad not cached

pull/1/head
yflory 7 years ago
parent b3e066eaca
commit 69014e5fde

@ -372,11 +372,9 @@ define([
var mediaMap = {}; var mediaMap = {};
var restoreMediaTags = function (tempDom) { var restoreMediaTags = function (tempDom) {
var pattern = /(<media-tag contenteditable="false" data-crypto-key="([^"]*)" src="([^"]*)" tabindex="1">)<\/media-tag>/i;
var tags = tempDom.querySelectorAll('media-tag:empty'); var tags = tempDom.querySelectorAll('media-tag:empty');
Cryptpad.slice(tags).forEach(function (tag) { Cryptpad.slice(tags).forEach(function (tag) {
if (pattern.length !== 4) { return; } var src = tag.getAttribute('src');
var src = pattern[3];
if (mediaMap[src]) { if (mediaMap[src]) {
mediaMap[src].forEach(function (n) { mediaMap[src].forEach(function (n) {
tag.appendChild(n); tag.appendChild(n);

Loading…
Cancel
Save