From 32bb10bcf365bce12c47678efa96ba4f1eff9830 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 30 May 2016 09:54:51 +0200 Subject: [PATCH] Fixed switching if confirm returns false. --- app/assets/javascripts/app/controllers/maintenance.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/controllers/maintenance.coffee b/app/assets/javascripts/app/controllers/maintenance.coffee index 8a556414a..666be1929 100644 --- a/app/assets/javascripts/app/controllers/maintenance.coffee +++ b/app/assets/javascripts/app/controllers/maintenance.coffee @@ -38,7 +38,9 @@ class Index extends App.ControllerContent setMode: (e) => value = @modeSetting.prop('checked') - return if value && !confirm('Sure?') + if value && !confirm('Sure?') + @modeSetting.prop('checked', false) + return value App.Setting.set('maintenance_mode', value) App.WebSocket.send( event:'maintenance'