Fix tapi search

This commit is contained in:
Daniel Triendl 2021-11-30 14:34:29 +01:00
parent bbe20d6351
commit 933b445ed6
2 changed files with 10 additions and 7 deletions

View File

@ -9,7 +9,7 @@ console.log('script start')
const search = new Search() const search = new Search()
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
waitForKeyElements('div.nav-search', (element) => { search.createSearchWindow(element) }, true) waitForKeyElements('ongoing-call-button', (element) => { search.createSearchWindow(element) }, true)
const callNotification = new CallNotification() const callNotification = new CallNotification()
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef

View File

@ -61,7 +61,7 @@ export class Search {
icon.style.color = 'grey' icon.style.color = 'grey'
searchWrapper.appendChild(icon) searchWrapper.appendChild(icon)
element.appendChild(form) element.parentElement.insertBefore(form, element)
} }
private removeSearchResults () { private removeSearchResults () {
@ -170,12 +170,15 @@ export class Search {
} }
private dial (number: string) { private dial (number: string) {
var searchInput = document.getElementsByName('searchByNumberInput') console.log('TAPI Search dialing', number);
if (searchInput.length > 0) { var searchInput = document.getElementById('dialpad-input');
(<HTMLInputElement>searchInput[0]).value = number (<HTMLInputElement>searchInput).value = number;
searchInput[0].focus() (<HTMLInputElement>searchInput).focus;
fireChangeEvents(searchInput);
fireChangeEvents(searchInput[0]) var toaster = document.querySelector('toaster-container');
if (window.getComputedStyle(toaster, null).display == 'none') {
document.getElementById('menuDialer').click();
} }
} }
} }