Add new tab animation
This commit is contained in:
@@ -16,6 +16,7 @@ export class NavigationTabModel {
|
||||
id = genTabId()
|
||||
history: HistoryItem[] = [{url: '/', ts: Date.now()}]
|
||||
index = 0
|
||||
isNewTab = false
|
||||
|
||||
constructor() {
|
||||
makeAutoObservable(this, {
|
||||
@@ -112,6 +113,10 @@ export class NavigationTabModel {
|
||||
this.current.title = title
|
||||
}
|
||||
|
||||
setIsNewTab(v: boolean) {
|
||||
this.isNewTab = v
|
||||
}
|
||||
|
||||
// persistence
|
||||
// =
|
||||
|
||||
@@ -208,6 +213,7 @@ export class NavigationModel {
|
||||
newTab(url: string, title?: string) {
|
||||
const tab = new NavigationTabModel()
|
||||
tab.navigate(url, title)
|
||||
tab.isNewTab = true
|
||||
this.tabs.push(tab)
|
||||
this.tabIndex = this.tabs.length - 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user