From 6497bc28c5f943869f076629c4317fbb2e4451df Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Thu, 25 Jun 2015 17:43:15 -0400 Subject: [PATCH] Show collapsible sections (other than 'dangerous settings') by default on preferences page --- .../views/scripts/form/preferences.phtml | 7 ++-- airtime_mvc/public/css/styles.css | 4 +- .../js/airtime/preferences/preferences.js | 39 +------------------ 3 files changed, 6 insertions(+), 44 deletions(-) diff --git a/airtime_mvc/application/views/scripts/form/preferences.phtml b/airtime_mvc/application/views/scripts/form/preferences.phtml index d200bf627..b5b96cb55 100644 --- a/airtime_mvc/application/views/scripts/form/preferences.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences.phtml @@ -9,10 +9,11 @@ - + -

-
+ +

+ diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index 35a8ce343..dac82da55 100644 --- a/airtime_mvc/public/css/styles.css +++ b/airtime_mvc/public/css/styles.css @@ -1841,7 +1841,6 @@ span.errors.sp-errors{ } .collapsible-content { margin-top:-1px; - display:none; } .collapsible-header .arrow-icon, .collapsible-header-disabled .arrow-icon { display:block; @@ -1853,9 +1852,8 @@ span.errors.sp-errors{ top:8px; } -.collapsible-header.closed .arrow-icon, collapsible-header-disabled.close .arrow-icon { +.collapsible-header.closed .arrow-icon, .collapsible-header-disabled.close .arrow-icon { background-position: 0 -11px !important; - } #schedule-add-show .button-bar { height: 28px; diff --git a/airtime_mvc/public/js/airtime/preferences/preferences.js b/airtime_mvc/public/js/airtime/preferences/preferences.js index 252a64a99..aeb6e27e7 100644 --- a/airtime_mvc/public/js/airtime/preferences/preferences.js +++ b/airtime_mvc/public/js/airtime/preferences/preferences.js @@ -99,41 +99,6 @@ function setMsAuthenticationFieldsReadonly(ele) { } } -function setCollapsibleWidgetJsCode() { - var x = function() { - var val = $('input:radio[name=thirdPartyApi]:checked').val(); - if (val == "1") { - //show js textarea - $('#widgetCode-label').show("fast"); - $('#widgetCode-element').show("fast"); - } else { - if ($('#widgetCode-label').is(":visible")) { - //hide js textarea - $('#widgetCode-label').hide(); - $('#widgetCode-element').hide(); - } - } - } - x(); - $('#thirdPartyApi-element input').click(x); -} - -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); - } - }); -} - function removeLogo() { $.post(baseUrl+'Preference/remove-logo', function(json){}); location.reload(); @@ -153,7 +118,7 @@ $(document).ready(function() { $(this).next().toggle('fast'); $(this).toggleClass("closed"); return false; - }).next().hide(); + }); if ($("#tunein-settings").find(".errors").length > 0) { $(".collapsible-content#tunein-settings").show(); @@ -176,12 +141,10 @@ $(document).ready(function() { showErrorSections(); - setSoundCloudCheckBoxListener(); setMailServerInputReadonly(); setSystemFromEmailReadonly(); setConfigureMailServerListener(); setEnableSystemEmailsListener(); - setCollapsibleWidgetJsCode(); setTuneInSettingsReadonly(); setTuneInSettingsListener(); });