flag styling

This commit is contained in:
Ali Abid 2021-02-11 09:30:06 -08:00
parent ba48c1fa07
commit 7c20812a0d
2 changed files with 6 additions and 10 deletions

View File

@ -109,12 +109,12 @@ input.submit {
input.submit:hover {
background-color: #f39c12;
}
.flagged {
background-color: pink !important;
.flag {
transition: background-color 100ms;
}
.flagged {
background-color: #e74c3c !important;
}
/* label:hover {
background-color: lightgray;
} */
.overlay {
position: absolute;
height: 100vh;

View File

@ -191,8 +191,6 @@ function gradio(config, fn, target, example_file_path) {
for (let output_interface of output_interfaces) {
output_interface.clear();
}
target.find(".flag").removeClass("flagged");
target.find(".flag").val("FLAG");
target.find(".flag_message").empty();
target.find(".loading").addClass("invisible");
target.find(".loading_time").text("");
@ -498,8 +496,6 @@ function gradio(config, fn, target, example_file_path) {
target.find(".submit").show();
target.find(".submit").click(function() {
io_master.gather();
target.find(".flag").removeClass("flagged");
target.find(".flag").val("FLAG");
})
}
if (!config.show_input) {
@ -509,7 +505,7 @@ function gradio(config, fn, target, example_file_path) {
target.find(".flag").click(function() {
if (io_master.last_output) {
target.find(".flag").addClass("flagged");
target.find(".flag").val("FLAGGED");
window.setTimeout(() => {target.find(".flag").removeClass("flagged");}, 100);
io_master.flag();
}
})