Lightbox escape keyboard shortcut also works

This commit is contained in:
Eric Eastwood 2022-06-07 22:35:26 -05:00
parent 5d9dc638ea
commit 72300d1b0c
3 changed files with 7 additions and 2 deletions

View File

@ -28,12 +28,14 @@ import type {Clock} from "../platform/web/dom/Clock";
import type {ILogger} from "../logging/types";
import type {Navigation} from "./navigation/Navigation";
import type {URLRouter} from "./navigation/URLRouter";
import type {History} from "../platform/web/dom/History";
export type Options = {
platform: Platform
logger: ILogger
urlCreator: URLRouter
navigation: Navigation
history: History
emitChange?: (params: any) => void
}
@ -142,4 +144,8 @@ export class ViewModel<O extends Options = Options> extends EventEmitter<{change
get navigation(): Navigation {
return this._options.navigation;
}
get history(): History {
return this._options.history;
}
}

View File

@ -96,6 +96,6 @@ export class LightboxViewModel extends ViewModel {
}
close() {
this.platform.history.pushUrl(this.closeUrl);
this.history.pushUrl(this.closeUrl);
}
}

View File

@ -36,7 +36,6 @@ import {ViewModel} from "../../../ViewModel";
export class TimelineViewModel extends ViewModel {
constructor(options) {
console.log('TimelineViewModel asdf', options)
super(options);
const {timeline, tileOptions} = options;
this._timeline = this.track(timeline);