Search Button on AddTask
This commit is contained in:
parent
68e80bc066
commit
7d96b0901f
@ -53,6 +53,7 @@
|
||||
</select>
|
||||
</addtask-setting>
|
||||
<addtask-setting><label for="searchPublicationQuery">Search Title</label><input id="searchPublicationQuery" type="text"></addtask-setting>
|
||||
<input type="submit" value="Search" onclick="NewSearch();">
|
||||
</addtask-settings>
|
||||
<div id="taskSelectOutput"></div>
|
||||
</window-content>
|
||||
|
@ -67,32 +67,36 @@ GetAvailableControllers()
|
||||
|
||||
searchPublicationQuery.addEventListener("keypress", (event) => {
|
||||
if(event.key === "Enter"){
|
||||
//Disable inputs
|
||||
selectRecurrence.disabled = true;
|
||||
connectorSelect.disabled = true;
|
||||
searchPublicationQuery.disabled = true;
|
||||
|
||||
//Empty previous results
|
||||
selectPublication.replaceChildren();
|
||||
GetPublication(connectorSelect.value, searchPublicationQuery.value)
|
||||
.then(json =>
|
||||
json.forEach(publication => {
|
||||
var option = CreatePublication(publication, connectorSelect.value);
|
||||
option.addEventListener("click", (mouseEvent) => {
|
||||
ShowPublicationViewerWindow(publication.internalId, mouseEvent, true);
|
||||
});
|
||||
selectPublication.appendChild(option);
|
||||
}
|
||||
))
|
||||
.then(() => {
|
||||
//Re-enable inputs
|
||||
selectRecurrence.disabled = false;
|
||||
connectorSelect.disabled = false;
|
||||
searchPublicationQuery.disabled = false;
|
||||
});
|
||||
NewSearch();
|
||||
}
|
||||
});
|
||||
|
||||
function NewSearch(){
|
||||
//Disable inputs
|
||||
selectRecurrence.disabled = true;
|
||||
connectorSelect.disabled = true;
|
||||
searchPublicationQuery.disabled = true;
|
||||
|
||||
//Empty previous results
|
||||
selectPublication.replaceChildren();
|
||||
GetPublication(connectorSelect.value, searchPublicationQuery.value)
|
||||
.then(json =>
|
||||
json.forEach(publication => {
|
||||
var option = CreatePublication(publication, connectorSelect.value);
|
||||
option.addEventListener("click", (mouseEvent) => {
|
||||
ShowPublicationViewerWindow(publication.internalId, mouseEvent, true);
|
||||
});
|
||||
selectPublication.appendChild(option);
|
||||
}
|
||||
))
|
||||
.then(() => {
|
||||
//Re-enable inputs
|
||||
selectRecurrence.disabled = false;
|
||||
connectorSelect.disabled = false;
|
||||
searchPublicationQuery.disabled = false;
|
||||
});
|
||||
}
|
||||
|
||||
//Returns a new "Publication" Item to display in the tasks section
|
||||
function CreatePublication(publication, connector){
|
||||
var publicationElement = document.createElement('publication');
|
||||
|
Loading…
Reference in New Issue
Block a user