Merge pull request #130 from throrin19/patch-data

elem.data() return all data if no params were bounds
master
Dmitry Baranovskiy 2013-12-19 17:02:33 -08:00
commit eb6a978ab1
1 changed files with 4 additions and 0 deletions

View File

@ -2276,6 +2276,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)) {