Fixed diffs

This commit is contained in:
Eduard Urbach 2019-04-22 15:05:16 +09:00
parent 06daacbbf6
commit 70a62f06e5
2 changed files with 21 additions and 10 deletions

View File

@ -30,15 +30,15 @@ component Profile(viewUser *arn.User, user *arn.User, animeList *arn.AnimeList,
.mountable(data-mountable-type="character") .mountable(data-mountable-type="character")
CharacterSmall(character, user) CharacterSmall(character, user)
//- People //- //- People
.profile-section //- .profile-section
h3.profile-column-header.mountable(data-mountable-type="favorites") People //- h3.profile-column-header.mountable(data-mountable-type="favorites") People
p.no-data.mountable(data-mountable-type="favorites") Nothing here yet. //- p.no-data.mountable(data-mountable-type="favorites") Nothing here yet.
//- Quotes //- //- Quotes
.profile-section //- .profile-section
h3.profile-column-header.mountable(data-mountable-type="favorites") Quotes //- h3.profile-column-header.mountable(data-mountable-type="favorites") Quotes
p.no-data.mountable(data-mountable-type="favorites") Nothing here yet. //- p.no-data.mountable(data-mountable-type="favorites") Nothing here yet.
//- Posts //- Posts
.profile-column.profile-activity.mountable(data-mountable-type="column") .profile-column.profile-activity.mountable(data-mountable-type="column")

View File

@ -3,13 +3,24 @@ import { requestIdleCallback } from "../Utils"
// Load // Load
export function load(arn: AnimeNotifier, element: HTMLElement) { export function load(arn: AnimeNotifier, element: HTMLElement) {
let url = element.dataset.url || (element as HTMLAnchorElement).href let url = element.dataset.url || (element as HTMLAnchorElement).getAttribute("href")
if(!url) {
arn.statusMessage.showError("Link doesn't have a target")
return
}
arn.app.load(url) arn.app.load(url)
} }
// Diff // Diff
export async function diff(arn: AnimeNotifier, element: HTMLElement) { export async function diff(arn: AnimeNotifier, element: HTMLElement) {
let url = element.dataset.url || (element as HTMLAnchorElement).href let url = element.dataset.url || (element as HTMLAnchorElement).getAttribute("href")
if(!url) {
arn.statusMessage.showError("Link doesn't have a target")
return
}
try { try {
await arn.diff(url) await arn.diff(url)