Skip to content

Commit

Permalink
Merge pull request #15 from anag0/dev
Browse files Browse the repository at this point in the history
fixes #14
  • Loading branch information
ernestmarcinko committed Oct 3, 2023
2 parents 9dc17b3 + 489da1f commit 1aa5867
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/domini-core.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/domini.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ <h2 class="text-body-emphasis">Dynamic Events on New items</h2>
Lorem ipsum
</li>
</ul>
<pre>$('#list2_add').on('click', function(){
<pre>$('#list2_add').on('mouseover', function(){
$('#list2').append("<li>New list item</li>");
});
$('#list2').on('mouseover', 'li', function(){
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "domini",
"version": "0.2.3",
"version": "0.2.4",
"description": "Minimalistic DOM manipulation tool",
"main": "dist/domini.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/core/selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ DoMini.fn.closest = function (s) {
let elements = [];
for ( let el of this ) {
if ( typeof s === "string" && s !== '' ) {
while ((el = el.parentElement) && !el.matches(s)) ;
while (!el.matches(s) && (el = el.parentElement)) ;
if ( !elements.includes(el) ) {
elements.push(el);
}
} else {
s = s instanceof DoMini ? s.get(0) : s;
if ( s instanceof Element ) {
while ((el = el.parentElement) && el !== s) ;
while (el !== s && (el = el.parentElement)) ;
} else {
el = null;
}
Expand Down

0 comments on commit 1aa5867

Please sign in to comment.