Created
September 14, 2021 22:29
-
-
Save JoelGeraci/3d0f96a221479f67c4b6dcdeef0068ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function executeSearch() { | |
var previewFilePromise = window.adobeFilePreview; | |
previewFilePromise.then(adobeViewer => { | |
adobeViewer.getAPIs().then(apis => { | |
if ($("#search-term").val().length == 0) { | |
$("#search-term").val($("#search-term").attr("placeholder")); | |
} | |
apis.search($("#search-term").val()).then(searchObject => { | |
window.searchObject = searchObject; | |
searchObject.onResultsUpdate(onResultsUpdate) | |
.catch(error => onFail(error)); | |
}) | |
.catch(error => onFail(error)); | |
}); | |
}); | |
} | |
function onResultsUpdate(result) { | |
updateSearchLocation(result) | |
} | |
function searchNext() { | |
window.searchObject.next(); | |
} | |
function searchPrevious() { | |
window.searchObject.previous(); | |
} | |
function searchClear() { | |
window.searchObject.clear(); | |
$(".search-location").css("display", "none"); | |
$("#search-term").val(""); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment