MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / expand

Method expand

tools/xsbug/FilePane.js:355–377  ·  view source on GitHub ↗
(table, expandIt)

Source from the content-addressed store, hash-verified

353
354class SearchTableBehavior extends TableBehavior {
355 expand(table, expandIt) {
356 var data = this.data;
357 var header = table.first;
358 data.expanded = expandIt;
359 table.empty(1);
360 if (expandIt) {
361 header.behavior.expand(header, true);
362 if (data.items) {
363 if (data.items.length) {
364 for (let item of data.items)
365 table.add(new ResultTable(item));
366 }
367 else
368 table.add(new SearchEmpty(data));
369 }
370 else
371 table.add(new SearchSpinner(data));
372 table.add(new SearchFooter(data));
373 }
374 else {
375 header.behavior.expand(header, false);
376 }
377 }
378 hold(table) {
379 return SearchHeader(this.data, {left:0, right:0, top:0, height:table.first.height});
380 }

Callers 3

onFindEditedMethod · 0.95
onFinishedMethod · 0.95
onSearchCompleteMethod · 0.95

Calls 3

emptyMethod · 0.65
addMethod · 0.65
expandMethod · 0.45

Tested by

no test coverage detected