Skip to content

Commit

Permalink
feat: left and right versions with info
Browse files Browse the repository at this point in the history
  • Loading branch information
kometenstaub committed Mar 11, 2022
1 parent 359823c commit 9124db5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/diff_view.ts
Expand Up @@ -52,25 +52,27 @@ export default class DiffView extends Modal {
const syncHistoryContentContainer = parsedHtml.documentElement
syncHistoryContentContainer.addClasses(['sync-history-content-container', 'diff'])

this.contentEl.appendChild(leftHistory)
this.contentEl.appendChild(leftHistory[0])
this.contentEl.appendChild(syncHistoryContentContainer);
this.contentEl.appendChild(rightHistory)
this.contentEl.appendChild(rightHistory[0])

this.appendVersions(leftHistory[1], versions)
this.appendVersions(rightHistory[1], versions)


} else {
new Notice('Something went wrong.');
}
}

createHistory(el: HTMLElement): HTMLElement {
createHistory(el: HTMLElement): HTMLElement[] {
const syncHistoryListContainer = el.createDiv({
cls: 'sync-history-list-container'
})
const syncHistoryList = syncHistoryListContainer.createDiv({
cls: 'sync-history-list'
})
return syncHistoryListContainer
return [syncHistoryListContainer, syncHistoryList]
}

appendVersions(el: HTMLElement, versions: gHResult): void {
Expand All @@ -79,6 +81,10 @@ export default class DiffView extends Modal {
cls: 'sync-history-list-item',
text: new Date(version.ts).toDateString()
})
const infoDiv = div.createDiv({
cls: ['u-small', 'u-muted'],
text: (version.size/1000).toString() + ' [' + version.device + ']'
})
}
}
}

0 comments on commit 9124db5

Please sign in to comment.