Comparing version 0.11.4 to 0.11.5
@@ -9,5 +9,5 @@ # Change Log | ||
## [0.11.4] | ||
## [0.11.5] | ||
### Fix | ||
- redundant condition | ||
- removed redundant condition and minor optimisation | ||
@@ -14,0 +14,0 @@ ## [0.11.0] |
25
el.js
@@ -27,15 +27,16 @@ var EVENTS = require('./src/events') | ||
if (key === 'style') node.style.cssText = val | ||
else if (typeof val !== 'string' || htmlProps[key]) node[key] = val | ||
else if (typeof val !== 'string' || htmlProps[key]) { | ||
node[key] = val | ||
//set synthetic events for onUpperCaseName | ||
if (key[0] === 'o' && key[1] === 'n' && key.charCodeAt(2) < 91 && key.charCodeAt(2) > 64 && !EVENTS[key]) { | ||
document.addEventListener(key.slice(2).toLowerCase(), function(e) { //eslint-disable-line | ||
var tgt = e.target | ||
do if (tgt[key]) return tgt[key](e) | ||
//@ts-ignore | ||
while((tgt = tgt.parentNode)) | ||
}) | ||
EVENTS[key] = true | ||
} | ||
} | ||
else node.setAttribute(key, val) | ||
//set synthetic events for onUpperCaseName | ||
if (key[0] === 'o' && key[1] === 'n' && key.charCodeAt(2) < 91 && key.charCodeAt(2) > 64 && !EVENTS[key]) { | ||
document.addEventListener(key.slice(2).toLowerCase(), function(e) { //eslint-disable-line | ||
var tgt = e.target | ||
do if (tgt[key]) return tgt[key](e) | ||
//@ts-ignore | ||
while((tgt = tgt.parentNode)) | ||
}) | ||
EVENTS[key] = true | ||
} | ||
} | ||
@@ -42,0 +43,0 @@ else { |
{ | ||
"name": "attodom", | ||
"version": "0.11.4", | ||
"version": "0.11.5", | ||
"main": "./index.js", | ||
@@ -5,0 +5,0 @@ "description": "yet another small DOM component library", |
@@ -10,5 +10,3 @@ # attodom | ||
* experimenting on different APIs to find the minimal helpers required for | ||
* dynamic nodes, elements and lists | ||
* one way data flow from root component to child nodes | ||
* experimenting on different APIs to find the minimal helpers required for dynamic nodes, elements and lists with one way data flow from root component to child nodes | ||
@@ -18,5 +16,5 @@ | ||
* no virtual DOM, all operations are done on actual nodes | ||
* multiple dynamic lists within the same parent | ||
* svg support | ||
* no virtual DOM, all operations are done on actual nodes | ||
* synthetic events available | ||
@@ -26,3 +24,3 @@ * < 1kb gzip, no dependencies | ||
* very low memory requirement | ||
* no transpilation required | ||
* no transpilation required, all ES5 | ||
@@ -29,0 +27,0 @@ |
25
svg.js
@@ -16,15 +16,16 @@ var EVENTS = require('./src/events') | ||
val = arg[key] | ||
if (typeof val !== 'string') node[key] = val | ||
if (typeof val !== 'string') { | ||
node[key] = val | ||
//set synthetic events for onUpperCaseName | ||
if (key[0] === 'o' && key[1] === 'n' && key.charCodeAt(2) < 91 && key.charCodeAt(2) > 64 && !EVENTS[key]) { | ||
document.addEventListener(key.slice(2).toLowerCase(), function(e) { //eslint-disable-line | ||
var tgt = e.target | ||
do if (tgt[key]) return tgt[key](e) | ||
//@ts-ignore | ||
while((tgt = tgt.parentNode)) | ||
}) | ||
EVENTS[key] = true | ||
} | ||
} | ||
else node.setAttribute(key, val) | ||
//set synthetic events for onUpperCaseName | ||
if (key[0] === 'o' && key[1] === 'n' && key.charCodeAt(2) < 91 && key.charCodeAt(2) > 64 && !EVENTS[key]) { | ||
document.addEventListener(key.slice(2).toLowerCase(), function(e) { //eslint-disable-line | ||
var tgt = e.target | ||
do if (tgt[key]) return tgt[key](e) | ||
//@ts-ignore | ||
while((tgt = tgt.parentNode)) | ||
}) | ||
EVENTS[key] = true | ||
} | ||
} | ||
@@ -31,0 +32,0 @@ else { |
17952
400
73