aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2020-04-04 21:25:32 +1000
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2020-04-04 21:25:32 +1000
commit8a6b109353d1e3ff24b996ffa3f412fb2f94de90 (patch)
tree916b489b3877ce27c44b7efe3d0851216d616986
parent7547a6a45818bcfefd545da4697196b81bd8da5b (diff)
downloadsvg.js-8a6b109353d1e3ff24b996ffa3f412fb2f94de90.tar.gz
svg.js-8a6b109353d1e3ff24b996ffa3f412fb2f94de90.zip
renamed removeNamespace()
-rw-r--r--CHANGELOG.md4
-rw-r--r--spec/spec/elements/Svg.js6
-rw-r--r--src/elements/Dom.js4
-rw-r--r--src/elements/Svg.js2
4 files changed, 8 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e39de5e..1152156 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,8 +20,8 @@ The document follows the conventions described in [“Keep a CHANGELOG”](http:
- fixed adopter when adopting an svg/html string. It had still its wrapper as parentNode attached
- fixed `put()` which correctly creates an svgjs object from the passed element now before returning
- fixed `parent()` which correctly returns null if direct parent is the document or a document-fragment
- - fixed `add()` which correctly removes namespaces of non-root svg elements now when added to another svg element
- - fixed `isRoot()` which correctly returns false, if the element is in a document-fragment (#1081)
+ - fixed `add()` which correctly removes namespaces of non-root svg elements now when added to another svg element (#1086)
+ - fixed `isRoot()` which correctly returns false, if the element is in a document-fragment
### Added
- added second Parameter to `SVG(el, isHTML)` which allows to explicitely create elements in the HTML namespace (#1058)
diff --git a/spec/spec/elements/Svg.js b/spec/spec/elements/Svg.js
index 804bdfd..f561366 100644
--- a/spec/spec/elements/Svg.js
+++ b/spec/spec/elements/Svg.js
@@ -100,10 +100,10 @@ describe('Svg.js', () => {
})
})
- describe('removeNamespaces()', () => {
+ describe('removeNamespace()', () => {
it('returns itself', () => {
const svg = new Svg()
- expect(svg.removeNamespaces()).toBe(svg)
+ expect(svg.removeNamespace()).toBe(svg)
})
it('removes the namespace attributes from the svg element', () => {
@@ -111,7 +111,7 @@ describe('Svg.js', () => {
expect(svg.attr('xmlns')).toBe(ns)
- svg.removeNamespaces()
+ svg.removeNamespace()
expect(svg.attr('xmlns')).toBe(undefined)
expect(svg.attr('version')).toBe(undefined)
diff --git a/src/elements/Dom.js b/src/elements/Dom.js
index ef51ad6..c523687 100644
--- a/src/elements/Dom.js
+++ b/src/elements/Dom.js
@@ -31,8 +31,8 @@ export default class Dom extends EventTarget {
element = makeInstance(element)
// If non-root svg nodes are added we have to remove their namespaces
- if (element.removeNamespaces && this.node instanceof globals.window.SVGElement) {
- element.removeNamespaces()
+ if (element.removeNamespace && this.node instanceof globals.window.SVGElement) {
+ element.removeNamespace()
}
if (i == null) {
diff --git a/src/elements/Svg.js b/src/elements/Svg.js
index 6672919..8699327 100644
--- a/src/elements/Svg.js
+++ b/src/elements/Svg.js
@@ -40,7 +40,7 @@ export default class Svg extends Container {
.attr('xmlns:svgjs', svgjs, xmlns)
}
- removeNamespaces () {
+ removeNamespace () {
return this.attr({ xmlns: null, version: null })
.attr('xmlns:xlink', null, xmlns)
.attr('xmlns:svgjs', null, xmlns)