diff --git a/airtime_mvc/application/forms/GeneralPreferences.php b/airtime_mvc/application/forms/GeneralPreferences.php index 420c2af71..b8a066e3e 100644 --- a/airtime_mvc/application/forms/GeneralPreferences.php +++ b/airtime_mvc/application/forms/GeneralPreferences.php @@ -49,6 +49,13 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm $stationLogoUpload->setAttrib('accept', 'image/*'); $this->addElement($stationLogoUpload); + $stationLogoRemove = new Zend_Form_Element_Button('stationLogoRemove'); + $stationLogoRemove->setLabel(_('Remove')); + $stationLogoRemove->setAttrib('class', 'btn'); + $stationLogoRemove->setAttrib('id', 'logo-remove-btn'); + $stationLogoRemove->setAttrib('onclick', 'removeLogo();'); + $this->addElement($stationLogoRemove); + //Default station crossfade duration $this->addElement('text', 'stationDefaultCrossfadeDuration', array( 'class' => 'input_text', diff --git a/airtime_mvc/application/views/scripts/form/preferences_general.phtml b/airtime_mvc/application/views/scripts/form/preferences_general.phtml index 65be0a13b..b93cb0a86 100644 --- a/airtime_mvc/application/views/scripts/form/preferences_general.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences_general.phtml @@ -7,10 +7,12 @@ element->getElement('stationLogo')->render() ?> - + element->getElement('stationLogoRemove')->render() ?> + +
- +
element->getElement('locale')->render() ?> diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index e99ac2f02..31a3f8383 100644 --- a/airtime_mvc/public/css/styles.css +++ b/airtime_mvc/public/css/styles.css @@ -2197,12 +2197,17 @@ dd.radio-inline-list, .preferences dd.radio-inline-list, .stream-config dd.radio height: 120px; } +.preferences #stationLogoRemove-label { + display: none; +} + .preferences #logo-remove-btn { float: right; + margin-bottom: 4px; } .preferences #Logo-img-container { - float: left; + margin-top: 30px; } #show_time_info { diff --git a/airtime_mvc/public/js/airtime/preferences/preferences.js b/airtime_mvc/public/js/airtime/preferences/preferences.js index 5af4893ee..1dffe24d2 100644 --- a/airtime_mvc/public/js/airtime/preferences/preferences.js +++ b/airtime_mvc/public/js/airtime/preferences/preferences.js @@ -115,6 +115,11 @@ function setSoundCloudCheckBoxListener() { }); } +function removeLogo() { + $.post(baseUrl+'Preference/remove-logo', function(json){}); + location.reload(); +} + $(document).ready(function() { $('.collapsible-header').live('click',function() { @@ -123,10 +128,6 @@ $(document).ready(function() { return false; }).next().hide(); - $('#logo-remove-btn').click(function() { - $.post(baseUrl+'Preference/remove-logo', function(json){}); - }); - /* No longer using AJAX for this form. Zend + our code makes it needlessly hard to deal with. -- Albert $('#pref_save').live('click', function() { var data = $('#pref_form').serialize();