diff --git a/src/index.js b/src/index.js index 6af313b..77ba41a 100644 --- a/src/index.js +++ b/src/index.js @@ -9,7 +9,7 @@ console.log('script start') const search = new Search() // 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() // eslint-disable-next-line no-undef diff --git a/src/search.ts b/src/search.ts index d8c3653..6672155 100644 --- a/src/search.ts +++ b/src/search.ts @@ -61,7 +61,7 @@ export class Search { icon.style.color = 'grey' searchWrapper.appendChild(icon) - element.appendChild(form) + element.parentElement.insertBefore(form, element) } private removeSearchResults () { @@ -170,12 +170,15 @@ export class Search { } private dial (number: string) { - var searchInput = document.getElementsByName('searchByNumberInput') - if (searchInput.length > 0) { - (searchInput[0]).value = number - searchInput[0].focus() + console.log('TAPI Search dialing', number); + var searchInput = document.getElementById('dialpad-input'); + (searchInput).value = number; + (searchInput).focus; + fireChangeEvents(searchInput); - fireChangeEvents(searchInput[0]) + var toaster = document.querySelector('toaster-container'); + if (window.getComputedStyle(toaster, null).display == 'none') { + document.getElementById('menuDialer').click(); } } }