Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Attr now doesn't serialize functions #216 #217

Closed
wants to merge 4 commits into from

2 participants

@Zig1375

Fix issue #216

@defunctzombie
Collaborator

please squash these commits and I will merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 15, 2013
  1. @Zig1375
  2. @Zig1375

    Update element.js

    Zig1375 authored
    Attr now doesn't serialize functions (second edition) #216
  3. @Zig1375

    Update element.js

    Zig1375 authored
  4. @Zig1375

    Update element.js

    Zig1375 authored
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/element.js
View
7 lib/element.js
@@ -29,9 +29,10 @@ Element.prototype.attr = function() {
if (typeof arg === 'object') {
// object setter
// iterate keys/value to set attributes
- for (var k in arg) {
- this._attr(k, arg[k]);
- };
+ var self = this;
+ Object.keys(arg).forEach(function(k){
+ self._attr(k, arg[k]);
+ });
return this;
} else if (typeof arg === 'string') {
// getter
Something went wrong with that request. Please try again.