From c11edea25340a188b3922e84f688dd4b701ed6f3 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 11 Jan 2013 13:13:36 -0500 Subject: [PATCH] CC-4802: Preferences -> Soundcloud settings: Sub-options can be checked before major one -fixed --- .../js/airtime/preferences/preferences.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/airtime_mvc/public/js/airtime/preferences/preferences.js b/airtime_mvc/public/js/airtime/preferences/preferences.js index fe5635faf..31c1e5768 100644 --- a/airtime_mvc/public/js/airtime/preferences/preferences.js +++ b/airtime_mvc/public/js/airtime/preferences/preferences.js @@ -80,6 +80,22 @@ function setMsAuthenticationFieldsReadonly(ele) { } } +function setSoundCloudCheckBoxListener() { + var subCheckBox= $("#UseSoundCloud,#SoundCloudDownloadbleOption"); + var mainCheckBox= $("#UploadToSoundcloudOption"); + subCheckBox.change(function(e){ + if (subCheckBox.is(':checked')) { + mainCheckBox.attr("checked", true); + } + }); + + mainCheckBox.change(function(e){ + if (!mainCheckBox.is(':checked')) { + $("#UseSoundCloud,#SoundCloudDownloadbleOption").attr("checked", false); + } + }); +} + $(document).ready(function() { $('.collapsible-header').live('click',function() { @@ -102,6 +118,7 @@ $(document).ready(function() { showErrorSections(); + setSoundCloudCheckBoxListener(); setMailServerInputReadonly(); setSystemFromEmailReadonly(); setConfigureMailServerListener();