MCPcopy Create free account
hub / github.com/breck7/scroll / _layoutGetRow

Function _layoutGetRow

external/.datatables.js:3344–3377  ·  view source on GitHub ↗

* Find, or create a layout row

(rows, rowNum, align)

Source from the content-addressed store, hash-verified

3342 * Find, or create a layout row
3343 */
3344 function _layoutGetRow(rows, rowNum, align) {
3345 var row
3346
3347 // Find existing rows
3348 for (var i = 0; i < rows.length; i++) {
3349 row = rows[i]
3350
3351 if (row.rowNum === rowNum) {
3352 // full is on its own, but start and end share a row
3353 if ((align === "full" && row.full) || ((align === "start" || align === "end") && (row.start || row.end))) {
3354 if (!row[align]) {
3355 row[align] = {
3356 contents: []
3357 }
3358 }
3359
3360 return row
3361 }
3362 }
3363 }
3364
3365 // If we get this far, then there was no match, create a new row
3366 row = {
3367 rowNum: rowNum
3368 }
3369
3370 row[align] = {
3371 contents: []
3372 }
3373
3374 rows.push(row)
3375
3376 return row
3377 }
3378
3379 /**
3380 * Convert a `layout` object given by a user to the object structure needed

Callers 1

_layoutArrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected