aboutsummaryrefslogtreecommitdiff
path: root/javascript/hires_fix.js
diff options
context:
space:
mode:
authorAarni Koskela <akx@iki.fi>2023-04-30 14:45:56 +0300
committerAarni Koskela <akx@iki.fi>2023-04-30 14:48:02 +0300
commit34a6ad80d5a3d6670a9e89089558e724d8c9f8bd (patch)
tree6af5083b3f8825c1a5f725e01b3af7245903133a /javascript/hires_fix.js
parentee973dcf1d1de44a248dc3a1b7043c9b8ebdc25a (diff)
Use classList.toggle wherever possible
Diffstat (limited to 'javascript/hires_fix.js')
-rw-r--r--javascript/hires_fix.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/javascript/hires_fix.js b/javascript/hires_fix.js
index 0629475f..ba175301 100644
--- a/javascript/hires_fix.js
+++ b/javascript/hires_fix.js
@@ -1,13 +1,9 @@
-function setInactive(elem, inactive){
- if(inactive){
- elem.classList.add('inactive')
- } else{
- elem.classList.remove('inactive')
+function onCalcResolutionHires(enable, width, height, hr_scale, hr_resize_x, hr_resize_y){
+ function setInactive(elem, inactive){
+ elem.classList.toggle('inactive', !!inactive)
}
-}
-function onCalcResolutionHires(enable, width, height, hr_scale, hr_resize_x, hr_resize_y){
hrUpscaleBy = gradioApp().getElementById('txt2img_hr_scale')
hrResizeX = gradioApp().getElementById('txt2img_hr_resize_x')
hrResizeY = gradioApp().getElementById('txt2img_hr_resize_y')