Commit 2dcfa3a6 by Thimo Kraemer

Added setNodeAttrs and setDataAttrs

parent 093633a8
/*
* KSS-RPC v0.10-beta
* KSS-RPC v0.11-beta
*
* Copyright (c) 2017, joonis new media
* Author: Thimo Kraemer <thimo.kraemer@joonis.de>
......@@ -61,7 +61,7 @@
******************************************************************************************/
var kss = {
version: '0.10-beta',
version: '0.11-beta',
_initialized: false,
_ruleSheets: {},
_eventBinders: {},
......@@ -1819,6 +1819,12 @@ kss.setNodeAttr = function(node, name, value) {
}
};
kss.setNodeAttrs = function(node, values) {
kss.each(values, function(value, name) {
this.setNodeAttr(node, name, value);
}, this);
};
kss.getDataAttr = function(node, name, recursive) {
return this.getNodeAttr(node, 'data-' + name.toLowerCase(), recursive);
};
......@@ -1827,6 +1833,12 @@ kss.setDataAttr = function(node, name, value) {
this.setNodeAttr(node, 'data-' + name.toLowerCase(), value);
};
kss.setDataAttrs = function(node, values) {
kss.each(values, function(value, name) {
this.setDataAttr(node, name, value);
}, this);
};
/*
// Get better initial computed rgba colors
window._getComputedStyle = window.getComputedStyle;
......@@ -2236,9 +2248,15 @@ kss.registerActionProvider({
setNodeAttr: function(node, params) {
kss.setNodeAttr(node, params.name, params.value);
},
setNodeAttrs: function(node, params) {
kss.setNodeAttrs(node, params);
},
setDataAttr: function(node, params) {
kss.setDataAttr(node, params.name, params.value);
},
setDataAttrs: function(node, params) {
kss.setDataAttrs(node, params);
},
setStyle: function(node, params) {
kss.setStyle(node, params.name, params.value);
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment