summaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-11-08 11:12:26 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-11-08 11:12:26 +0100
commit834c05b0a251f38043a7961dab920f20720c1144 (patch)
tree36b610ca049952079468f03f1902f376124ddaa8 /src/modules
parent4702522137dac17a6312c521f3c1974eb839c5eb (diff)
downloadsvg.js-834c05b0a251f38043a7961dab920f20720c1144.tar.gz
svg.js-834c05b0a251f38043a7961dab920f20720c1144.zip
get rid of the fixmes and todos
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/core/circled.js1
-rw-r--r--src/modules/core/gradiented.js1
-rw-r--r--src/modules/optional/class.js10
-rw-r--r--src/modules/optional/css.js1
-rw-r--r--src/modules/optional/memory.js5
5 files changed, 8 insertions, 10 deletions
diff --git a/src/modules/core/circled.js b/src/modules/core/circled.js
index 9a3b1ad..b94d237 100644
--- a/src/modules/core/circled.js
+++ b/src/modules/core/circled.js
@@ -1,4 +1,3 @@
-// FIXME: import this to runner
import { proportionalSize } from '../../utils/utils.js'
import SVGNumber from '../../types/SVGNumber.js'
diff --git a/src/modules/core/gradiented.js b/src/modules/core/gradiented.js
index d34a9fe..6c744e4 100644
--- a/src/modules/core/gradiented.js
+++ b/src/modules/core/gradiented.js
@@ -1,4 +1,3 @@
-// FIXME: add to runner
import SVGNumber from '../../types/SVGNumber.js'
export function from (x, y) {
diff --git a/src/modules/optional/class.js b/src/modules/optional/class.js
index 1d28fd5..b08c82b 100644
--- a/src/modules/optional/class.js
+++ b/src/modules/optional/class.js
@@ -2,18 +2,18 @@ import { delimiter } from '../core/regex.js'
import { registerMethods } from '../../utils/methods.js'
// Return array of classes on the node
-function classes () {
+export function classes () {
var attr = this.attr('class')
return attr == null ? [] : attr.trim().split(delimiter)
}
// Return true if class exists on the node, false otherwise
-function hasClass (name) {
+export function hasClass (name) {
return this.classes().indexOf(name) !== -1
}
// Add class to the node
-function addClass (name) {
+export function addClass (name) {
if (!this.hasClass(name)) {
var array = this.classes()
array.push(name)
@@ -24,7 +24,7 @@ function addClass (name) {
}
// Remove class from the node
-function removeClass (name) {
+export function removeClass (name) {
if (this.hasClass(name)) {
this.attr('class', this.classes().filter(function (c) {
return c !== name
@@ -35,7 +35,7 @@ function removeClass (name) {
}
// Toggle the presence of a class on the node
-function toggleClass (name) {
+export function toggleClass (name) {
return this.hasClass(name) ? this.removeClass(name) : this.addClass(name)
}
diff --git a/src/modules/optional/css.js b/src/modules/optional/css.js
index 924b13d..babee7a 100644
--- a/src/modules/optional/css.js
+++ b/src/modules/optional/css.js
@@ -1,4 +1,3 @@
-// FIXME: We dont need exports
import { camelCase } from '../../utils/utils.js'
import { isBlank } from '../core/regex.js'
import { registerMethods } from '../../utils/methods.js'
diff --git a/src/modules/optional/memory.js b/src/modules/optional/memory.js
index d1bf7cf..6478367 100644
--- a/src/modules/optional/memory.js
+++ b/src/modules/optional/memory.js
@@ -1,5 +1,4 @@
import { registerMethods } from '../../utils/methods.js'
-// FIXME: We need a constructor to set this up
// Remember arbitrary data
export function remember (k, v) {
@@ -31,7 +30,9 @@ export function forget () {
return this
}
-// return local memory object
+// This triggers creation of a new hidden class which is not performant
+// However, this function is not rarely used so it will not happen frequently
+// Return local memory object
export function memory () {
return (this._memory = this._memory || {})
}