From 5644c261d072930576db60b61c618075905ff4a3 Mon Sep 17 00:00:00 2001 From: Seth Meranda <smeranda2@unl.edu> Date: Wed, 29 Sep 2010 16:32:23 +0000 Subject: [PATCH] allow the action bar to switch back and forth between both options. --- plugins/unl_theme/scripts/JS/actionNotice.js | 69 ++++++++++++++------ plugins/unl_theme/views/default/css.php | 1 + 2 files changed, 49 insertions(+), 21 deletions(-) diff --git a/plugins/unl_theme/scripts/JS/actionNotice.js b/plugins/unl_theme/scripts/JS/actionNotice.js index e8dae814..e816d66c 100644 --- a/plugins/unl_theme/scripts/JS/actionNotice.js +++ b/plugins/unl_theme/scripts/JS/actionNotice.js @@ -1,22 +1,49 @@ $(document).ready(function(){ - $('#actionBar.casLogin a.switchAction').click(function(){ - $('#casOption .loginMessage').fadeOut('fast', function(){ - $('#casOption').animate({ - 'width' : '120px' - }, function(){ - $('#casLogin').animate({ - 'opacity' : '0.3' - }); - }); - $('#elggOption').animate({ - 'width' : '790px' - }, function(){ - $('.optionMessage').fadeOut('fast', function(){ - $('#actionBar').removeClass('casLogin').addClass('elggLogin'); - $('.elggLoginForm').fadeIn('fast'); - }); - }); - }); - return false; - }) -}); \ No newline at end of file + $('#actionBar a.switchAction').click(function(){ + if($(this).parents('#actionBar').hasClass('casLogin')){ + showElggLogin(); + } else { + showCASLogin(); + } + return false; + }); +}); +function showElggLogin() { + $('#casOption .loginMessage').fadeOut('fast', function(){ + $('#casOption').animate({ + 'width' : '120px' + }, function(){ + $('#casLogin').animate({ + 'opacity' : '0.3' + }); + }); + $('#elggOption').animate({ + 'width' : '790px' + }, function(){ + $('.optionMessage').fadeOut('fast', function(){ + $('.elggLoginForm').fadeIn('fast'); + $('#actionBar').removeClass('casLogin').addClass('elggLogin'); + }); + }); + }); +} + +function showCASLogin() { + $('.elggLoginForm').fadeOut('fast', function(){ + $('#elggOption').animate({ + 'width' : '220px' + }, function(){ + $('.optionMessage').fadeIn('fast', function(){ + $('#actionBar').addClass('casLogin').removeClass('elggLogin'); + }); + }); + $('#casOption').animate({ + 'width' : '690px' + }, function(){ + $('#casLogin').animate({ + 'opacity' : '1' + }); + $('#casOption .loginMessage').fadeIn('fast'); + }); + }); +} \ No newline at end of file diff --git a/plugins/unl_theme/views/default/css.php b/plugins/unl_theme/views/default/css.php index fee22487..edea38de 100644 --- a/plugins/unl_theme/views/default/css.php +++ b/plugins/unl_theme/views/default/css.php @@ -48,6 +48,7 @@ display:inline-block; padding:15px; height:64px; + min-width:910px; } #casOption { float:left; -- GitLab