]> source.dussan.org Git - svg.js.git/commitdiff
renamed removeNamespace()
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>
Sat, 4 Apr 2020 11:25:32 +0000 (21:25 +1000)
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>
Sat, 4 Apr 2020 11:25:32 +0000 (21:25 +1000)
CHANGELOG.md
spec/spec/elements/Svg.js
src/elements/Dom.js
src/elements/Svg.js

index e39de5ed0f8fb0d4206576516bdbec575874754b..1152156765308efdea26f10af5b55cd18ad1f641 100644 (file)
@@ -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)
index 804bdfd634807cdbc22e83a9b0efd89244096cdc..f5613668992d4e53c965a1016292295f76d5a2e2 100644 (file)
@@ -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)
index ef51ad628dfc5e6d08c5927b3d5000d5f815c318..c523687d55a378e7e33fa9260fbba23b07d7a42b 100644 (file)
@@ -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) {
index 667291978f84544324e293d26096476cd8e4217f..869932701cb7cac50f5d659f9d8615c4acb88b0e 100644 (file)
@@ -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)