-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add xlinkHref property to SurgicalElement
Add updateElementAttributeNS Bump version to 0.5.3
- Loading branch information
Showing
3 changed files
with
13 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "surgical", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"license": "MIT", | ||
"description": "Surgical is a declarative JavaScript library with native DOM flexibility and performance, for building fast UIs.", | ||
"author": "Andreas Svensson <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default function updateElementAttributeNS(node, namespaceURI, name, nextValue, lastValue) { | ||
if (nextValue !== lastValue) { | ||
if (nextValue != null && nextValue !== false) { | ||
node.setAttributeNS(namespaceURI, name, (nextValue === true ? '' : nextValue)); | ||
} else if (lastValue != null && lastValue !== false) { | ||
node.removeAttributeNS(namespaceURI, name); | ||
} | ||
} | ||
} |