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

Method selectFile

tools/xsbug/main.js:521–544  ·  view source on GitHub ↗
(path, state)

Source from the content-addressed store, hash-verified

519 }
520 }
521 selectFile(path, state) {
522 path = this.mapPath(path, true);
523 if (this.path != path) {
524 let items = this.history.items;
525 let index = items.findIndex(item => item.path == path);
526 if (index >= 0)
527 items.splice(index, 1);
528 application.distribute("onStateChanging", this.state);
529 if (this.path && (this.path != "preferences") && (this.path != "device")) {
530 items.unshift({ path:this.path, state:this.state });
531 if (items.length > 32)
532 items.length = 32;
533 }
534 application.distribute("onHistoryChanged");
535 this.path = path;
536 this.state = state;
537 this.doOpenView();
538 application.distribute("onPathChanged", this.path);
539 }
540 else {
541 this.state = state;
542 application.distribute("onStateChanged", state);
543 }
544 }
545
546 readPreferences() {
547 try {

Callers 13

doPreferencesMethod · 0.95
doOpenFileCallbackMethod · 0.95
onTapMethod · 0.80
onTapMethod · 0.80
onTouchEndedMethod · 0.80
onTapMethod · 0.80
onTapMethod · 0.80
onTapMethod · 0.80
onTapMethod · 0.80
onTapMethod · 0.80
DebugBehavior.jsFile · 0.80
onTapMethod · 0.80

Calls 3

doOpenViewMethod · 0.95
distributeMethod · 0.80
findIndexMethod · 0.65

Tested by

no test coverage detected