MediaWiki:Common.js: различия между версиями
Kerisar (обсуждение | вклад) мНет описания правки |
Kerisar (обсуждение | вклад) мНет описания правки |
||
| Строка 215: | Строка 215: | ||
iframe.src = src; | iframe.src = src; | ||
// Копируем все атрибуты из исходного элемента | // Копируем все атрибуты из исходного элемента, кроме data-атрибутов | ||
Array.prototype.forEach.call(element.attributes, function(attr) { | Array.prototype.forEach.call(element.attributes, function(attr) { | ||
if (attr.name | if (!attr.name.startsWith('data-')) { | ||
iframe.setAttribute(attr.name, attr.value); | iframe.setAttribute(attr.name, attr.value); | ||
} | } | ||
| Строка 233: | Строка 233: | ||
iframe.srcdoc = srcdoc; | iframe.srcdoc = srcdoc; | ||
// Копируем все атрибуты из исходного элемента | // Копируем все атрибуты из исходного элемента, кроме data-атрибутов | ||
Array.prototype.forEach.call(element.attributes, function(attr) { | Array.prototype.forEach.call(element.attributes, function(attr) { | ||
if (attr.name | if (!attr.name.startsWith('data-')) { | ||
iframe.setAttribute(attr.name, attr.value); | iframe.setAttribute(attr.name, attr.value); | ||
} | } | ||