From 0c42db5749d531697e453b70d0f8936d0a1768c1 Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Sun, 26 May 2019 22:36:01 +0200 Subject: [PATCH] Simplify toggleLayout --- assets/javascripts/app/settings.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/app/settings.coffee b/assets/javascripts/app/settings.coffee index ed09d980..5068a76c 100644 --- a/assets/javascripts/app/settings.coffee +++ b/assets/javascripts/app/settings.coffee @@ -124,5 +124,6 @@ class app.Settings classList[if enable then 'add' else 'remove']('_theme-dark') toggleLayout: (layout, enable) -> - document.body.classList[if enable then 'add' else 'remove'](layout) unless layout is SIDEBAR_HIDDEN_LAYOUT - document.body.classList[if $.overlayScrollbarsEnabled() then 'add' else 'remove']('_overlay-scrollbars') + classList = document.body.classList + classList[if enable then 'add' else 'remove'](layout) unless layout is SIDEBAR_HIDDEN_LAYOUT + classList[if $.overlayScrollbarsEnabled() then 'add' else 'remove']('_overlay-scrollbars')