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

Method display

contributed/conversationalAI/Controller.js:32–56  ·  view source on GitHub ↗
(container, view, backwards)

Source from the content-addressed store, hash-verified

30 this.view = null;
31 }
32 display(container, view, backwards) {
33 if (this.view) {
34 this.onScreenUndisplaying(container, this.view);
35 if (backwards)
36 this.view.runTransitionBackwards(view);
37 else {
38 if (this.view.historical)
39 this.history.push(this.view);
40 view.runTransitionForwards(this.view);
41 }
42 }
43 else {
44 this.container.add(new view.Template(view));
45 this.going = 0;
46 this.onScreenDisplayed(container, view);
47 }
48 this.view = view;
49 if (this.forgottenHistory) {
50 this.history.length = this.forgottenHistory;
51 this.forgottenHistory = 0;
52 }
53 trace("HISTORY:");
54 this.history.forEach(view => trace(" " + view.id));
55 trace("\n");
56 }
57 forgetHistory(forgottenHistory = 1) {
58 this.forgottenHistory = forgottenHistory;
59 }

Callers 1

onDisplayingMethod · 0.95

Calls 6

onScreenUndisplayingMethod · 0.95
onScreenDisplayedMethod · 0.95
addMethod · 0.65
pushMethod · 0.45
runTransitionForwardsMethod · 0.45

Tested by

no test coverage detected