MCPcopy
hub / github.com/jbaysolutions/vue-grid-layout / sortLayoutItemsByRowCol

Function sortLayoutItemsByRowCol

src/helpers/utils.js:387–399  ·  view source on GitHub ↗
(layout: Layout)

Source from the content-addressed store, hash-verified

385 * @return {Array} Layout, sorted static items first.
386 */
387export function sortLayoutItemsByRowCol(layout: Layout): Layout {
388 return [].concat(layout).sort(function(a, b) {
389 if (a.y === b.y && a.x === b.x) {
390 return 0;
391 }
392
393 if (a.y > b.y || (a.y === b.y && a.x > b.x)) {
394 return 1;
395 }
396
397 return -1;
398 });
399}
400
401/**
402 * Generate a layout using the initialLayout and children as a template.

Callers 3

utils.spec.jsFile · 0.90
compactFunction · 0.85
moveElementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…