| 482 | */ | 482 | */ |
| 483 | function setFittingClass(fitting) { | 483 | function setFittingClass(fitting) { |
| 484 | const backgrounds = $('#bg1, #bg_custom'); | 484 | const backgrounds = $('#bg1, #bg_custom'); |
| 485 | backgrounds.toggleClass('cover', fitting === 'cover'); | 485 | for (const option of ['cover', 'contain', 'stretch', 'center']) { |
| 486 | backgrounds.toggleClass('contain', fitting === 'contain'); | 486 | backgrounds.toggleClass(option, option === fitting); |
| 487 | backgrounds.toggleClass('stretch', fitting === 'stretch'); | 487 | } |
| 488 | backgrounds.toggleClass('center', fitting === 'center'); | 488 | background_settings.fitting = fitting; |
| 489 | } | 489 | } |
| 490 | | 490 | |
| 491 | function onBackgroundFilterInput() { | 491 | function onBackgroundFilterInput() { |