MCPcopy Index your code
hub / github.com/SortableJS/Sortable / indexOfObject

Function indexOfObject

modular/sortable.complete.esm.js:429–437  ·  view source on GitHub ↗

* Returns the index of the object within the given array * @param {Array} arr Array that may or may not hold the object * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find * @return {Number} The index of th

(arr, obj)

Source from the content-addressed store, hash-verified

427 * @return {Number} The index of the object in the array, or -1
428 */
429function indexOfObject(arr, obj) {
430 for (var i in arr) {
431 if (!arr.hasOwnProperty(i)) continue;
432 for (var key in obj) {
433 if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
434 }
435 }
436 return -1;
437}
438function getParentAutoScrollElement(el, includeSelf) {
439 // skip to window
440 if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();

Callers 1

AnimationStateManagerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…