aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-11-17 10:42:19 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-11-17 10:42:19 +0100
commit079f6f0ac37cb6d62501e8c397cc9850936f26e6 (patch)
treecfdac1e222180436b1e8bcf245c3fbb2140224a8
parentbf6e2aeb13f9a4bee2be1f8f7a70ca1a73215245 (diff)
downloadsvg.js-079f6f0ac37cb6d62501e8c397cc9850936f26e6.tar.gz
svg.js-079f6f0ac37cb6d62501e8c397cc9850936f26e6.zip
cleanup a few files
-rw-r--r--CHANGELOG.md8
-rw-r--r--src/animation/Controller.js2
-rw-r--r--src/elements/Dom.js3
-rw-r--r--src/modules/core/selector.js2
-rw-r--r--src/types/EventTarget.js24
5 files changed, 17 insertions, 22 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 034cdae..b9b35d0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,13 +11,11 @@ The document follows the conventions described in [“Keep a CHANGELOG”](http:
## UNRELEASED 3.0.0
### Added
-- added `SVG.$()` and `SVG.$$()` which will query for one/multiple elements
- added `text()` method to `SVG.Path` to create a textPath from this path (#705)
- added `SVG.HTMLNode` which is the object wrapped around html nodes to put something in them
- added `dispatch()` method on `SVG.Element` which returns the dispatched event for event cancelation (#550)
- added `isRoot()` on `SVG.Doc` (#809)
- added `random` option and `randomize()` method to `SVG.Color` -> __TODO!__
-- added `precision()` method to round numeric element attributes -> __TODO!__
- added a linter during the npm build process
- added `npm build:dev` to let you develop without getting too annoyed
- added `beziere()` and `steps()` to generate easing functions
@@ -52,7 +50,6 @@ The document follows the conventions described in [“Keep a CHANGELOG”](http:
- replaced static reference to `clipper` in `SVG.ClipPath` with the `clipper()` method
- replaced static reference to `targets` in `SVG.Mask` and `SVG.ClipPath` with the `targets()` method
- moved all regexes to `SVG.regex`
-- `svg()` will now return the element without svg-wrapper
- new constructor signature for `SVG.Image` and `load()`: `container.image(src, callback) / image.load(src, callback)` (#706)
- changed `style()` to `css()`. Now accepts array as input and returns object when no argument given (#517)
- ids are not generated upon creation anymore. Instead they are generated when requested (#559)
@@ -60,11 +57,11 @@ The document follows the conventions described in [“Keep a CHANGELOG”](http:
- `SVG.Text.path()` now returns an instance of SVG.TextPath (#705)
- `SVG.Text.path()` does not move all contents to the textPath (#705)
- `SVG.TextPath` now inherits from `SVG.Text` and can be manipulated the same way (#705)
-- `SVG.Text.textPath()` now returns all textPaths in the text element (#705)
+- `SVG.Text.textPath()` returns the first textPaths in the text element (#705)
- renamed `SVG.Stop` constructor `at()` on `SVG.Gradient` to `stop()` (#707)
- renamed `fill()` method on `SVG.Gradient` and `SVG.Pattern` to `url()` (#708)
- renamed `previous()` method to `prev()`
-- changed `childNodes` to `children` (same for `firstChild`, `lastChild`, ...) (#710)
+- changed `childNodes` to `children` (same for `firstChild`, `lastChild`, ...) (#710) - changed it back because of performance drop
- moved `defs()` method from `SVG.Parent` to `SVG.Element`
- `SVG()` can be called with css selector, node or svg string, now. Without an argument it creates a new `SVG.Doc()` (#646)
- `add()`, `put()`, `addTo()`, `putIn()` now excepts all arguments accepted by `SVG()`
@@ -82,7 +79,6 @@ The document follows the conventions described in [“Keep a CHANGELOG”](http:
- `Element.svg()` now can can replace the current node, can export the children of a node and can take an export modifier to change/replace the exported nodes
- `ungroup()` now breaks off one container and not more
- `clone()` does not add the clone to the dom anymore
-- `SVG.Text.textPath()` returns only the first textpath child
- `attr()` excepts array now to get multiple values at once
- `SVG.Text.rebuild()` now takes every font-size into account (#512)
- `fill()` and `stroke()` return the fill and stroke attribute when called as getter (#789)
diff --git a/src/animation/Controller.js b/src/animation/Controller.js
index 537a075..cee7115 100644
--- a/src/animation/Controller.js
+++ b/src/animation/Controller.js
@@ -45,7 +45,7 @@ export let easing = {
}
}
},
- // https://www.w3.org/TR/css-easing-1/#step-timing-function-algo
+ // see https://www.w3.org/TR/css-easing-1/#step-timing-function-algo
steps: function (steps, stepPosition = 'end') {
// deal with "jump-" prefix
stepPosition = stepPosition.split('-').reverse()[0]
diff --git a/src/elements/Dom.js b/src/elements/Dom.js
index 55d5858..0808443 100644
--- a/src/elements/Dom.js
+++ b/src/elements/Dom.js
@@ -6,6 +6,7 @@ import {
makeInstance,
register
} from '../utils/adopter.js'
+import { find } from '../modules/core/selector';
import { globals } from '../utils/window.js'
import { map } from '../utils/utils.js'
import { ns } from '../modules/core/namespaces.js'
@@ -301,5 +302,5 @@ export default class Dom extends EventTarget {
}
}
-extend(Dom, { attr })
+extend(Dom, { attr, find })
register(Dom)
diff --git a/src/modules/core/selector.js b/src/modules/core/selector.js
index 83a919f..6fcf05e 100644
--- a/src/modules/core/selector.js
+++ b/src/modules/core/selector.js
@@ -14,5 +14,3 @@ export default function baseFind (query, parent) {
export function find (query) {
return baseFind(query, this.node)
}
-
-registerMethods('Dom', { find })
diff --git a/src/types/EventTarget.js b/src/types/EventTarget.js
index 31d01df..5a005fd 100644
--- a/src/types/EventTarget.js
+++ b/src/types/EventTarget.js
@@ -9,18 +9,6 @@ export default class EventTarget extends Base {
addEventListener () {}
- // Bind given event to listener
- on (event, listener, binding, options) {
- on(this, event, listener, binding, options)
- return this
- }
-
- // Unbind event from listener
- off (event, listener) {
- off(this, event, listener)
- return this
- }
-
dispatch (event, data) {
return dispatch(this, event, data)
}
@@ -54,5 +42,17 @@ export default class EventTarget extends Base {
return this
}
+ // Unbind event from listener
+ off (event, listener) {
+ off(this, event, listener)
+ return this
+ }
+
+ // Bind given event to listener
+ on (event, listener, binding, options) {
+ on(this, event, listener, binding, options)
+ return this
+ }
+
removeEventListener () {}
}