Skip to content

Commit

Permalink
Update build
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Noogen committed May 18, 2017
1 parent 1f9e98d commit c94f3d2
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 25 deletions.
32 changes: 17 additions & 15 deletions lib/wu.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/wu.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions lib/wu.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/wu.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wu",
"version": "0.2.7",
"version": "0.2.8",
"description": "web utils",
"main": "lib/wu.js",
"scripts": {
Expand Down
14 changes: 10 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,14 @@ export default class Wu {

this.has = has;
this.keys = keys;
this.each = this.forEach = each;

this.isNull = isNull;
this.win = myRoot;
this.doc = this.win.document || {};
this.each = this.forEach = this.each = each;
this.collect = this.map;
this.any = this.some;
this.getAttribute = this.getAttr;
this.attr = this.getAttribute = this.getAttr;
this.setAttribute = this.setAttr;
this.emitter = emitter;
this.domify = domify;
Expand Down Expand Up @@ -304,9 +305,14 @@ export default class Wu {
* helper method to get attribute on specific dom object
* @param {object} dom element
* @param {string} attr attribute name
* @param {object} value attribute value
* @return {string} attribute value
*/
getAttr(dom, attr) {
getAttr(dom, attr, val) {
if (arguments.length > 2) {
return this.setAttr(dom, attr, val);
}

let el = dom[0] || dom;

return (el.getAttribute) ? el.getAttribute(attr) : el[attr];
Expand Down Expand Up @@ -350,7 +356,7 @@ export default class Wu {
el[attr] = value;
};

return el;
return value;
}

/**
Expand Down

0 comments on commit c94f3d2

Please sign in to comment.