object.keys workaround

This commit is contained in:
vitalets
2012-11-27 00:37:15 +04:00
parent 612ecc5e55
commit 396775bf8c
2 changed files with 107 additions and 91 deletions
src

@ -2,8 +2,7 @@
* EditableForm utilites * EditableForm utilites
*/ */
(function ($) { (function ($) {
$.extend($.fn.editableform, { $.fn.editableform.utils = {
utils: {
/** /**
* classic JS inheritance function * classic JS inheritance function
*/ */
@ -99,7 +98,24 @@
} }
}); });
return data; return data;
},
objectKeys: function(o) {
if (Object.keys) {
return Object.keys(o);
} else {
if (o !== Object(o)) {
throw new TypeError('Object.keys called on a non-object');
}
var k=[], p;
for (p in o) {
if (Object.prototype.hasOwnProperty.call(o,p)) {
k.push(p);
} }
} }
}); return k;
}
}
};
}(window.jQuery)); }(window.jQuery));

@ -1,5 +1,5 @@
/** /**
Select (dropdown) input Select (dropdown)
@class select @class select
@extends list @extends list