mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added native menu support in desktop mode. #5503
This commit is contained in:
@@ -51,43 +51,47 @@ export function onlineHelpSearch(param, props) {
|
||||
let iframeHTML = content.document;
|
||||
window.pooling = setInterval(() => {
|
||||
let resultEl = iframeHTML.getElementById('search-results');
|
||||
let searchResultsH2Tags = resultEl.getElementsByTagName('h2');
|
||||
let list = resultEl && resultEl.getElementsByTagName('LI');
|
||||
let pooling = window.pooling;
|
||||
if ((list && list.length > 0 )) {
|
||||
let res = extractSearchResult(list);
|
||||
// After getting the data, we need to call the Parent component function
|
||||
// which will render the data on the screen
|
||||
if (searchResultsH2Tags[0]['childNodes'][0]['textContent'] != 'Searching') {
|
||||
window.clearInterval(pooling);
|
||||
if(resultEl) {
|
||||
let searchResultsH2Tags = resultEl.getElementsByTagName('h2');
|
||||
let list = resultEl && resultEl.getElementsByTagName('LI');
|
||||
if ((list && list.length > 0 )) {
|
||||
let res = extractSearchResult(list);
|
||||
// After getting the data, we need to call the Parent component function
|
||||
// which will render the data on the screen
|
||||
if (searchResultsH2Tags[0]['childNodes'][0]['textContent'] != 'Searching') {
|
||||
window.clearInterval(pooling);
|
||||
setState(state => ({
|
||||
...state,
|
||||
fetched: true,
|
||||
clearedPooling: true,
|
||||
url: srcURL,
|
||||
data: res,
|
||||
}));
|
||||
isIFrameLoaded = false;
|
||||
ReactDOM.unmountComponentAtNode(document.getElementById('quick-search-iframe-container'));
|
||||
} else {
|
||||
setState(state => ({
|
||||
...state,
|
||||
fetched: true,
|
||||
clearedPooling: false,
|
||||
url: srcURL,
|
||||
data: res,
|
||||
}));
|
||||
}
|
||||
} else if(searchResultsH2Tags[0]['childNodes'][0]['textContent'] == 'Search Results') {
|
||||
setState(state => ({
|
||||
...state,
|
||||
fetched: true,
|
||||
clearedPooling: true,
|
||||
url: srcURL,
|
||||
data: res,
|
||||
data: {},
|
||||
}));
|
||||
isIFrameLoaded = false;
|
||||
ReactDOM.unmountComponentAtNode(document.getElementById('quick-search-iframe-container'));
|
||||
} else {
|
||||
setState(state => ({
|
||||
...state,
|
||||
fetched: true,
|
||||
clearedPooling: false,
|
||||
url: srcURL,
|
||||
data: res,
|
||||
}));
|
||||
isIFrameLoaded = false;
|
||||
window.clearInterval(pooling);
|
||||
}
|
||||
} else if(searchResultsH2Tags[0]['childNodes'][0]['textContent'] == 'Search Results') {
|
||||
setState(state => ({
|
||||
...state,
|
||||
fetched: true,
|
||||
clearedPooling: true,
|
||||
url: srcURL,
|
||||
data: {},
|
||||
}));
|
||||
ReactDOM.unmountComponentAtNode(document.getElementById('quick-search-iframe-container'));
|
||||
isIFrameLoaded = false;
|
||||
} else {
|
||||
window.clearInterval(pooling);
|
||||
}
|
||||
}, 500);
|
||||
|
||||
Reference in New Issue
Block a user