From cccacf4e6a1020e4ce0b672468d17c3be581a8a7 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 26 Sep 2014 14:31:44 -0700 Subject: [PATCH] disable the save button if no settings are changed --- domain-server/resources/web/js/settings.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/domain-server/resources/web/js/settings.js b/domain-server/resources/web/js/settings.js index 8bb02e6e94..c436b47b9c 100644 --- a/domain-server/resources/web/js/settings.js +++ b/domain-server/resources/web/js/settings.js @@ -64,7 +64,15 @@ $(document).ready(function(){ // this input was changed, add the changed data attribute to it $(this).attr('data-changed', true) + $('.save-button').removeAttr('disabled') + badgeSidebarForDifferences($(this)) + + if ($('span.badge:not(:empty)').length == 0) { + // if all badges are empty we have no changed values + // so we can disable the save button again + $('.save-button').attr('disabled', true) + } }) $('#advanced-toggle-button').click(function(){