Skip to content

Commit

Permalink
flag/screenshot btn fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aliabd committed Aug 3, 2020
1 parent e5f7efd commit 4b69268
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions gradio/static/js/gradio.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,20 @@ function gradio(config, fn, target) {
io_master.last_input = null;
io_master.last_output = null;
});
if (config["allow_screenshot"]) {

if (config["allow_screenshot"] && !config["allow_flagging"]) {
target.find(".screenshot").css("visibility", "visible");
target.find(".flag").css("display", "none")
}
if(config["allow_flagging"]){
if (!config["allow_screenshot"] && config["allow_flagging"]) {
target.find(".flag").css("visibility", "visible");
target.find(".screenshot").css("display", "none")
}
if (config["allow_screenshot"] && config["allow_flagging"]) {
target.find(".screenshot").css("visibility", "visible");
target.find(".flag").css("visibility", "visible")
}

target.find(".screenshot").click(function() {
$(".screenshot").hide();
$(".screenshot_logo").show();
Expand Down

0 comments on commit 4b69268

Please sign in to comment.