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

Method toggleOpen

tools/xsbug-log/xsbug-debugmachine.js:847–861  ·  view source on GitHub ↗
(item, callback, viewName)

Source from the content-addressed store, hash-verified

845 // Toggle an item open (expand it). After the view updates, fires callback.
846 // viewName optionally specifies which view to wait for (e.g. 'modules').
847 toggleOpen(item, callback, viewName) {
848 if (!this.isExpandable(item) || !item.value) {
849 callback();
850 return;
851 }
852 this.pendingViewName = viewName || 'global';
853 this.pendingViewCallback = (items, name) => {
854 if (name === 'property' && items) {
855 item.children = items;
856 item.flags = '-' + item.flags.slice(1);
857 }
858 callback();
859 };
860 this.doToggle(item.value);
861 }
862
863 // Format a value for display in compact WebKit-style format.
864 // depth 0 = expand one level of properties; depth 1+ = abbreviate.

Callers 12

_expandForCompletionMethod · 0.95
_expandNextPrototypeMethod · 0.95
_expandPathMethod · 0.95
gatherAllLocalsMethod · 0.95
resolveDotPathMethod · 0.95
expandAndSearchMethod · 0.95
searchGlobalItemsMethod · 0.95
cmdInfoModulesMethod · 0.95
resolveModulePathMethod · 0.95

Calls 4

isExpandableMethod · 0.95
doToggleMethod · 0.80
sliceMethod · 0.65
callbackFunction · 0.50

Tested by

no test coverage detected