Skip to content

Commit

Permalink
release v0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bcinarli committed Jan 24, 2018
1 parent 72a8301 commit 40ac463
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ el.replaceWith('<div id="replaced">Previous element replaced</div>');
### Traversing
With traversal methods, you can find adjacent or parent elements accordingly. Almost all traversal methods returns a `uxr` object. You can return the previous `uxr` by chaining `end()`
```javascript
``` js

let el = uxr('li');

Expand Down
13 changes: 9 additions & 4 deletions dist/uxr.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* uxr
**/

const _ = window.uxr = function (selector) {
const _ = window['uxr'] = function (selector) {
return new uxr(selector);
};

Expand Down Expand Up @@ -323,15 +323,19 @@ _.ready = function (fn) {
_.extend.closest = function (selector) {
let el = this.el[0];

if (!selector) {
return mutated(this, [el.parentNode]);
}

while (el !== null && el.nodeType === 1) {
if (el.matches(selector)) {
return el;
return mutated(this, [el]);
}

el = el.parentNode;
}

return null;
return mutated(this, []);
};

_.extend.next = function (selector) {
Expand All @@ -350,6 +354,7 @@ _.extend.last = function () {
let last = this.length - 1;
return mutated(this, this.el.filter((item, index) => index === last));
};

/**
* utils
**/
Expand Down Expand Up @@ -498,5 +503,5 @@ _.extend.unwrap = function (selector) {

return this;
};
_.uxr = { version: '0.4.0' };
_.uxr = { version: '0.4.1' };
})();
30 changes: 15 additions & 15 deletions dist/uxr.min.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uxr",
"version": "0.4.0",
"version": "0.4.1",
"description": "DOM utilities",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 40ac463

Please sign in to comment.