From 99385db0c418fb49838eb1a23f391cf826d99202 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sun, 7 Aug 2016 11:01:47 -0700 Subject: #3320 code cleanup --- public/js/gogs.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'public/js') diff --git a/public/js/gogs.js b/public/js/gogs.js index 7ca90b2826..226bb6bae5 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -187,9 +187,24 @@ function initInstall() { } }); + // TODO: better handling of exclusive relations. $('#offline-mode input').change(function () { if ($(this).is(':checked')) { $('#disable-gravatar').checkbox('check'); + $('#federated-avatar-lookup').checkbox('uncheck'); + } + }); + $('#disable-gravatar input').change(function () { + if ($(this).is(':checked')) { + $('#federated-avatar-lookup').checkbox('uncheck'); + } else { + $('#offline-mode').checkbox('uncheck'); + } + }); + $('#federated-avatar-lookup input').change(function () { + if ($(this).is(':checked')) { + $('#disable-gravatar').checkbox('uncheck'); + $('#offline-mode').checkbox('uncheck'); } }); $('#disable-registration input').change(function () { -- cgit v1.2.3