Skip to content

Commit

Permalink
fix Sometimes send to * doesn't change to the appropriate tab AUTOMAT…
Browse files Browse the repository at this point in the history
  • Loading branch information
anapnoe committed Apr 20, 2023
1 parent df22e91 commit 56543c3
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 9 deletions.
51 changes: 44 additions & 7 deletions javascript/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ function submit(){
var id = randomId()
requestProgress(id, gradioApp().getElementById('txt2img_gallery_container'), gradioApp().getElementById('txt2img_gallery'), function(){
showSubmitButtons('txt2img', true)

})

var res = create_submit_args(arguments)
Expand Down Expand Up @@ -450,6 +449,31 @@ onUiUpdate(function(){

})

/* gradioApp().querySelectorAll('[id^="image_buttons_"] button').forEach(function (elem){
if(elem.id == "txt2img_tab"){
elem.setAttribute("tab-id", 0);
elem.removeEventListener('click', navTabClicked);
elem.addEventListener('click', navTabClicked);
}else if(elem.id == "img2img_tab" || elem.id == "inpaint_tab"){
elem.setAttribute("tab-id", 1);
elem.removeEventListener('click', navTabClicked);
elem.addEventListener('click', navTabClicked);
}if(elem.id == "extras_tab"){
elem.setAttribute("tab-id", 2);
elem.removeEventListener('click', navTabClicked);
elem.addEventListener('click', navTabClicked);
}
}) */

/* const pdiv = gradioApp().querySelector("#"+selectedTabItemId+" .progressDiv");
if(!pdiv && selectedTabItemId == "tab_txt2img"){
showSubmitButtons('txt2img', true);
}else if(!pdiv && selectedTabItemId == "tab_img2img"){
showSubmitButtons('img2img', true);
} */


//window.onUiHeaderTabUpdate();
// also here the same issue
/*
Expand All @@ -471,6 +495,7 @@ onUiUpdate(function(){
netMenuVisibility();
}


// menu
function disableScroll() {
scrollTop = window.pageYOffset || document.documentElement.scrollTop;
Expand Down Expand Up @@ -824,11 +849,9 @@ onUiUpdate(function(){
function navigate2TabItem(idx){
gradioApp().querySelectorAll('#tabs > div.tabitem').forEach(function (tabitem, index){
if(idx == index){
tabitem.style.display = "block";
//tabitem.classList.add("wtf");
tabitem.style.display = "block";
}else{
tabitem.style.display = "none";
//tabitem.classList.remove("wtf");
tabitem.style.display = "none";
}
})
}
Expand Down Expand Up @@ -866,7 +889,6 @@ onUiUpdate(function(){
parent_header_tabs.append(clonetab);
clonetab.addEventListener('click', navTabClicked);


})

let div = document.createElement("div");
Expand Down Expand Up @@ -899,9 +921,24 @@ onUiUpdate(function(){
updateOpStyles();
}
})

tabsHiddenChange();

gradioApp().querySelectorAll('[id^="image_buttons_"] button, #png_2img_results button').forEach(function (elem){

if(elem.id == "txt2img_tab"){
elem.setAttribute("tab-id", 0);
elem.addEventListener('click', navTabClicked);
}else if(elem.id == "img2img_tab" || elem.id == "inpaint_tab"){
elem.setAttribute("tab-id", 1);
elem.addEventListener('click', navTabClicked);
}if(elem.id == "extras_tab"){
elem.setAttribute("tab-id", 2);
elem.addEventListener('click', navTabClicked);
}
})


// add - remove quicksettings
const settings_submit = gradioApp().querySelector('#settings_submit');
const quick_parent = gradioApp().querySelector("#quicksettings_overflow_container");
Expand Down
14 changes: 12 additions & 2 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ License: GNU General Public License
--ae-top-header-inner-height:38px;
--ae-top-header-height: calc( var(--ae-top-header-padding-top) + var(--ae-top-header-inner-height) + var(--ae-top-header-padding-bottom) );
--ae-container-padding:16px;
--ae-footer-height: calc( 38px + (var(--ae-container-padding) * 2) );
--ae-footer-height: calc( 30px + (var(--ae-container-padding) * 2) );
--ae-gallery-bottom-height: calc(24px + (var(--ae-max-padding) * 2) + 16px + (var(--ae-inside-padding-size) * 2) + (var(--ae-outside-gap-size)* 3 ));

--ae-subtract-total: calc( var(--ae-top-header-height) + var(--ae-footer-height));
Expand Down Expand Up @@ -1263,6 +1263,7 @@ input.svelte-56zyyb{
}
[id$="2img_styles"] label > span{
padding-right: 5px;
margin-bottom:0!important;
}

[id$="2img_token_counter"].block,
Expand Down Expand Up @@ -2758,7 +2759,15 @@ pre {
/************/
/* Footer */
/************/

.app.svelte-ac4rv4.svelte-ac4rv4 {
min-height: 100vh !important;
}
.main > .wrap > .contain{
flex-grow: 1;
display: flex;
flex-direction: column;
}

footer {
display: none !important;
}
Expand Down Expand Up @@ -2794,6 +2803,7 @@ footer {
border-radius: 100%;
position: relative;
display: flex;
margin: 0 !important;
}

.footer-links > li > div,
Expand Down

0 comments on commit 56543c3

Please sign in to comment.