Spaces:
Paused
Paused
P01yH3dr0n
commited on
Commit
•
ee50c99
1
Parent(s):
d5aefaa
Update tagcomplete/javascript/tagAutocomplete.js
Browse files
tagcomplete/javascript/tagAutocomplete.js
CHANGED
@@ -622,47 +622,6 @@ async function updateSelectionStyle(textArea, newIndex, oldIndex) {
|
|
622 |
// Set scrolltop to selected item
|
623 |
resultDiv.scrollTop = selected.offsetTop - resultDiv.offsetTop;
|
624 |
}
|
625 |
-
|
626 |
-
// Show preview if enabled and the selected type supports it
|
627 |
-
if (newIndex !== null) {
|
628 |
-
let selected = items[newIndex];
|
629 |
-
let previewTypes = ["v1 Embedding", "v2 Embedding", "Hypernetwork", "Lora", "Lyco"];
|
630 |
-
let selectedType = selected.querySelector(".acMetaText").innerText;
|
631 |
-
let selectedFilename = selected.querySelector(".acListItem").innerText;
|
632 |
-
|
633 |
-
let previewDiv = gradioApp().querySelector(`.autocompleteParent${textAreaId} .sideInfo`);
|
634 |
-
|
635 |
-
if (TAC_CFG.showExtraNetworkPreviews && previewTypes.includes(selectedType)) {
|
636 |
-
let shorthandType = "";
|
637 |
-
switch (selectedType) {
|
638 |
-
case "v1 Embedding":
|
639 |
-
case "v2 Embedding":
|
640 |
-
shorthandType = "embed";
|
641 |
-
break;
|
642 |
-
case "Hypernetwork":
|
643 |
-
shorthandType = "hyper";
|
644 |
-
break;
|
645 |
-
case "Lora":
|
646 |
-
shorthandType = "lora";
|
647 |
-
break;
|
648 |
-
case "Lyco":
|
649 |
-
shorthandType = "lyco";
|
650 |
-
break;
|
651 |
-
}
|
652 |
-
|
653 |
-
let img = previewDiv.querySelector("img");
|
654 |
-
|
655 |
-
let url = await getExtraNetworkPreviewURL(selectedFilename, shorthandType);
|
656 |
-
if (url) {
|
657 |
-
img.src = url;
|
658 |
-
previewDiv.style.display = "block";
|
659 |
-
} else {
|
660 |
-
previewDiv.style.display = "none";
|
661 |
-
}
|
662 |
-
} else {
|
663 |
-
previewDiv.style.display = "none";
|
664 |
-
}
|
665 |
-
}
|
666 |
}
|
667 |
|
668 |
// Check if the last edit was the keyword insertion, and catch undo/redo in that case
|
@@ -1082,4 +1041,3 @@ async function run() {
|
|
1082 |
setup();
|
1083 |
tacLoading = false;
|
1084 |
}
|
1085 |
-
run();
|
|
|
622 |
// Set scrolltop to selected item
|
623 |
resultDiv.scrollTop = selected.offsetTop - resultDiv.offsetTop;
|
624 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
625 |
}
|
626 |
|
627 |
// Check if the last edit was the keyword insertion, and catch undo/redo in that case
|
|
|
1041 |
setup();
|
1042 |
tacLoading = false;
|
1043 |
}
|
|