Commit 34a6ad80 authored by Aarni Koskela's avatar Aarni Koskela

Use classList.toggle wherever possible

parent ee973dcf
function setInactive(elem, inactive){ function onCalcResolutionHires(enable, width, height, hr_scale, hr_resize_x, hr_resize_y){
if(inactive){ function setInactive(elem, inactive){
elem.classList.add('inactive') elem.classList.toggle('inactive', !!inactive)
} else{
elem.classList.remove('inactive')
} }
}
function onCalcResolutionHires(enable, width, height, hr_scale, hr_resize_x, hr_resize_y){
hrUpscaleBy = gradioApp().getElementById('txt2img_hr_scale') hrUpscaleBy = gradioApp().getElementById('txt2img_hr_scale')
hrResizeX = gradioApp().getElementById('txt2img_hr_resize_x') hrResizeX = gradioApp().getElementById('txt2img_hr_resize_x')
hrResizeY = gradioApp().getElementById('txt2img_hr_resize_y') hrResizeY = gradioApp().getElementById('txt2img_hr_resize_y')
......
...@@ -144,11 +144,7 @@ function setupImageForLightbox(e) { ...@@ -144,11 +144,7 @@ function setupImageForLightbox(e) {
} }
function modalZoomSet(modalImage, enable) { function modalZoomSet(modalImage, enable) {
if (enable) { if(modalImage) modalImage.classList.toggle('modalImageFullscreen', !!enable);
modalImage.classList.add('modalImageFullscreen');
} else {
modalImage.classList.remove('modalImageFullscreen');
}
} }
function modalZoomToggle(event) { function modalZoomToggle(event) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment