|
|
|
@ -133,11 +133,11 @@ export default class BindingWrapper {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case 'text':
|
|
|
|
|
case 'textContent':
|
|
|
|
|
update_conditions.push(`${this.snippet} !== ${parent.var}.textContent`);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'html':
|
|
|
|
|
case 'innerHTML':
|
|
|
|
|
update_conditions.push(`${this.snippet} !== ${parent.var}.innerHTML`);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
@ -170,7 +170,7 @@ export default class BindingWrapper {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.node.name === 'html' || this.node.name === 'text') {
|
|
|
|
|
if (this.node.name === 'innerHTML' || this.node.name === 'textContent') {
|
|
|
|
|
block.builders.mount.add_block(`if (${this.snippet} !== void 0) ${update_dom}`);
|
|
|
|
|
} else if (!/(currentTime|paused)/.test(this.node.name)) {
|
|
|
|
|
block.builders.mount.add_block(update_dom);
|
|
|
|
@ -208,14 +208,6 @@ function get_dom_updater(
|
|
|
|
|
return `${element.var}.checked = ${condition};`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (binding.node.name === 'text') {
|
|
|
|
|
return `${element.var}.textContent = ${binding.snippet};`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (binding.node.name === 'html') {
|
|
|
|
|
return `${element.var}.innerHTML = ${binding.snippet};`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return `${element.var}.${binding.node.name} = ${binding.snippet};`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -328,14 +320,6 @@ function get_value_from_dom(
|
|
|
|
|
return `@time_ranges_to_array(this.${name})`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (name === 'text') {
|
|
|
|
|
return `this.textContent`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (name === 'html') {
|
|
|
|
|
return `this.innerHTML`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// everything else
|
|
|
|
|
return `this.${name}`;
|
|
|
|
|
}
|
|
|
|
|