mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-27 19:19:21 +03:00
Again replaced some jQuery to native and cleaned up normalize.css without IE
This commit is contained in:
parent
4977494f6b
commit
645831368d
13 changed files with 649 additions and 318 deletions
|
|
@ -10,24 +10,19 @@ class ScriptComponent extends AbstractComponent {
|
|||
if (
|
||||
params.component &&
|
||||
params.component.templateNodes &&
|
||||
params.element &&
|
||||
params.element[0] &&
|
||||
params.element[0].outerHTML
|
||||
params.element
|
||||
) {
|
||||
let script = params.element[0].outerHTML;
|
||||
script = !script ? '' : script.replace(/<x-script/i, '<script').replace(/<b><\/b><\/x-script>/i, '</script>');
|
||||
let el = params.element, script = el.outerHTML;
|
||||
script = script ? script.replace(/<x-script/i, '<script').replace(/<b><\/b><\/x-script>/i, '</script>') : '';
|
||||
|
||||
if (script) {
|
||||
params.element.text('');
|
||||
params.element.replaceWith(
|
||||
jQuery(script).text(
|
||||
params.component.templateNodes[0] && params.component.templateNodes[0].nodeValue
|
||||
? params.component.templateNodes[0].nodeValue
|
||||
: ''
|
||||
)
|
||||
const koNodes = params.component.templateNodes[0];
|
||||
el.textContent = '';
|
||||
el.replaceWith(
|
||||
Element.fromHTML(script).textContent = koNodes && koNodes.nodeValue ? koNodes.nodeValue : ''
|
||||
);
|
||||
} else {
|
||||
params.element.remove();
|
||||
el.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue