+ elem.data() return all data if no params were bounds

master
Benjamin Besse 2013-11-25 11:02:19 +01:00
parent 8302edf2a1
commit 46899ad251
1 changed files with 4 additions and 0 deletions

View File

@ -2241,6 +2241,10 @@ function arrayFirstValue(arr) {
\*/
elproto.data = function (key, value) {
var data = eldata[this.id] = eldata[this.id] || {};
if (arguments.length == 0){
eve("snap.data.get." + this.id, this, data, null);
return data;
}
if (arguments.length == 1) {
if (Snap.is(key, "object")) {
for (var i in key) if (key[has](i)) {