Skip to content

Commit

Permalink
Merge pull request #95 from uzairfarooq/dev
Browse files Browse the repository at this point in the history
Release 2.5.2
  • Loading branch information
uzairfarooq authored Dec 19, 2024
2 parents 40404a9 + e83fe21 commit 3604235
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "arrive",
"version": "2.5.1",
"version": "2.5.2",
"description": "Watch for DOM elements creation and removal.",
"main": "src/arrive.js",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions minified/arrive.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": "arrive",
"version": "2.5.1",
"version": "2.5.2",
"description": "arrive.js provides events to watch for DOM elements creation and removal. It makes use of Mutation Observers internally.",
"main": "src/arrive.js",
"directories": {
Expand Down
7 changes: 4 additions & 3 deletions src/arrive.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/*
* arrive.js
* v2.5.1
* v2.5.2
* https://github.com/uzairfarooq/arrive
* MIT licensed
*
Expand Down Expand Up @@ -41,8 +41,9 @@ var Arrive = (function(window, $, undefined) {
};
},
callCallbacks: function(callbacksToBeCalled, registrationData, mutationEvents) {
// firedElems check because firedElems are not added in case of leave events
if (registrationData && registrationData.options.onceOnly && registrationData.firedElems.length <= 1) {
if (!callbacksToBeCalled.length) return;

if (registrationData && registrationData.options.onceOnly) {
// as onlyOnce param is true, make sure we fire the event for only one item
callbacksToBeCalled = [callbacksToBeCalled[0]];

Expand Down

0 comments on commit 3604235

Please sign in to comment.