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

Function indexOfObject

Sortable.js:435–443  ·  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

(arr, obj)

Source from the content-addressed store, hash-verified

433 * @return {Number} The index of the object in the array, or -1
434 */
435 function indexOfObject(arr, obj) {
436 for (var i in arr) {
437 if (!arr.hasOwnProperty(i)) continue;
438 for (var key in obj) {
439 if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
440 }
441 }
442 return -1;
443 }
444 function getParentAutoScrollElement(el, includeSelf) {
445 // skip to window
446 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…