From 9e5d93bad204c58b565f20a832ea1fd25830e480 Mon Sep 17 00:00:00 2001 From: Daniel Triendl Date: Tue, 30 Nov 2021 14:11:34 +0100 Subject: [PATCH] Fix call history --- src/call-history.ts | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/call-history.ts b/src/call-history.ts index 14d7e1e..5959ff4 100644 --- a/src/call-history.ts +++ b/src/call-history.ts @@ -6,18 +6,12 @@ export class CallHistory { private callerIds: { [number: string]: TapiContact } = {} private updateCallHistoryEntry (call: HTMLElement, callerId: TapiContact) { - var span = call.querySelector('span') - this.showTimeManager(call, span.nextSibling.textContent.trim(), callerId) + var span = call.querySelector(':scope > span') + this.showTimeManager(call, call.querySelector('.date').textContent, callerId) if (callerId && callerId.tD_NAME !== '') { var text = span.textContent - span.textContent = callerId.tD_NAME - var br = document.createElement('br') - var span2 = document.createElement('span') - span2.style.fontSize = 'small' - span2.textContent = text - span.parentNode.insertBefore(br, span.nextSibling) - span.parentNode.insertBefore(span2, span.nextSibling) + span.textContent = callerId.tD_NAME + ' ' + callerId.tD_NUMBER } } @@ -28,7 +22,6 @@ export class CallHistory { date = dateParts.groups.date duration = dateParts.groups.duration } - var parsedDate = chrono.de.parseDate(date) if (!parsedDate) { parsedDate = chrono.parseDate(date) @@ -50,7 +43,7 @@ export class CallHistory { var length = (parsedDuration.getHours() * 60 + parsedDuration.getMinutes()).toString() - var toolbar = call.querySelector('.wcToolbarTiles') + var toolbar = call.querySelector('call-history-options') var href = 'domizil://PM/Zeitbuchung?' if (callerId && callerId.tD_ID) { href += 'KontaktId=' + callerId.tD_ID + '&' @@ -62,7 +55,7 @@ export class CallHistory { a.onclick = () => { window.open(href) } - a.innerHTML = '' + + a.innerHTML = '' + '' + ' ' + '