Also check for null-valued attributes

pull/1668/head
Christian Kaisermann 6 years ago
parent 790f2b5313
commit 89c1fa675b

@ -82,7 +82,7 @@ export function removeListener(node, event, handler) {
}
export function setAttribute(node, attribute, value) {
if (value === undefined) removeAttribute(node, attribute);
if (value == null) removeAttribute(node, attribute);
else node.setAttribute(attribute, value);
}

@ -22,7 +22,12 @@ function createText(data) {
}
function setAttribute(node, attribute, value) {
node.setAttribute(attribute, value);
if (value == null) removeAttribute(node, attribute);
else node.setAttribute(attribute, value);
}
function removeAttribute(node, attribute) {
node.removeAttribute(attribute);
}
function blankObject() {

@ -22,7 +22,12 @@ function createSvgElement(name) {
}
function setAttribute(node, attribute, value) {
node.setAttribute(attribute, value);
if (value == null) removeAttribute(node, attribute);
else node.setAttribute(attribute, value);
}
function removeAttribute(node, attribute) {
node.removeAttribute(attribute);
}
function blankObject() {

@ -26,7 +26,12 @@ function removeListener(node, event, handler) {
}
function setAttribute(node, attribute, value) {
node.setAttribute(attribute, value);
if (value == null) removeAttribute(node, attribute);
else node.setAttribute(attribute, value);
}
function removeAttribute(node, attribute) {
node.removeAttribute(attribute);
}
function blankObject() {

@ -26,7 +26,12 @@ function removeListener(node, event, handler) {
}
function setAttribute(node, attribute, value) {
node.setAttribute(attribute, value);
if (value == null) removeAttribute(node, attribute);
else node.setAttribute(attribute, value);
}
function removeAttribute(node, attribute) {
node.removeAttribute(attribute);
}
function toNumber(value) {

@ -26,7 +26,12 @@ function removeListener(node, event, handler) {
}
function setAttribute(node, attribute, value) {
node.setAttribute(attribute, value);
if (value == null) removeAttribute(node, attribute);
else node.setAttribute(attribute, value);
}
function removeAttribute(node, attribute) {
node.removeAttribute(attribute);
}
function blankObject() {

Loading…
Cancel
Save