Skip to content

Commit

Permalink
Merge pull request #93 from uzairfarooq/dev
Browse files Browse the repository at this point in the history
Prepare release 2.5.1
  • Loading branch information
uzairfarooq authored Nov 27, 2024
2 parents ab1b8eb + 28c55a5 commit 2ac2c6b
Show file tree
Hide file tree
Showing 4 changed files with 10 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.0",
"version": "2.5.1",
"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.0",
"version": "2.5.1",
"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
9 changes: 6 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.0
* v2.5.1
* https://github.com/uzairfarooq/arrive
* MIT licensed
*
Expand Down Expand Up @@ -363,7 +363,7 @@ var Arrive = (function(window, $, undefined) {
// override bindEvent function
arriveEvents.bindEvent = function(selector, arg2, arg3) {

var options = (typeof arg2 === 'object') ? utils.mergeArrays(arriveDefaultOptions, arg2) : arriveDefaultOptions;
var options = (typeof arg2 === 'object') ? utils.mergeArrays(arriveDefaultOptions, arg2) : { ...arriveDefaultOptions };
var callback = (typeof arg3 === 'function') ? arg3 : (typeof arg2 === 'function') ? arg2 : undefined;
var elements = utils.toElementsArray(this);

Expand Down Expand Up @@ -449,12 +449,15 @@ var Arrive = (function(window, $, undefined) {
// override bindEvent function
leaveEvents.bindEvent = function(selector, arg2, arg3) {

var options = (typeof arg2 === 'object') ? utils.mergeArrays(leaveDefaultOptions, arg2) : leaveDefaultOptions;
var options = (typeof arg2 === 'object') ? utils.mergeArrays(leaveDefaultOptions, arg2) : { ...leaveDefaultOptions };
var callback = (typeof arg3 === 'function') ? arg3 : (typeof arg2 === 'function') ? arg2 : undefined;

if (callback) {
mutationBindEvent.call(this, selector, options, callback);
} else {
// For promise and async support, we can only do onceOnly=true
options.onceOnly = true;

var a = this;
return new Promise(resolve => mutationBindEvent.call(a, selector, options, resolve));
}
Expand Down

0 comments on commit 2ac2c6b

Please sign in to comment.