From c2bf5a90fc76eda220b35b510b7a200a43c858b1 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 14 Jan 2014 10:52:53 +0000 Subject: Cleanup popup notices. Move HTML to view from controller, use same elements for other country popup and everypage - partly so they don't display on top of each other anymore. Don't position them over existing content, position them at the top of the page. Use consistent styling, and keep the javascript unobtrusive. --- public/javascripts/general.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'public/javascripts/general.js') diff --git a/public/javascripts/general.js b/public/javascripts/general.js index 989907998..529bbeb04 100644 --- a/public/javascripts/general.js +++ b/public/javascripts/general.js @@ -7,7 +7,7 @@ $(document).ready(function() { dataType: 'html', success: function(country_message){ if (country_message != ''){ - $('#other-country-notice').html(country_message); + $('#other-country-notice .popup-content').html(country_message); $('body:not(.front) #other-country-notice').show() } } @@ -16,10 +16,17 @@ $(document).ready(function() { } } - $('#other-country-notice').click(function() { - $('#other-country-notice').hide(); + // popup messages + $('#other-country-notice .popup-close').click(function() { + $('#other-country-notice').hide('slow'); $.cookie('has_seen_country_message', 1, {expires: 365, path: '/'}); }); + $('#everypage .popup-close').click(function() { + $('#everypage').hide('slow'); + $.cookie('seen_foi2', 1, { expires: 7, path: '/' }); + return false; + }); + // "link to this" widget $('a.link_to_this').click(function() { var box = $('div#link_box'); -- cgit v1.2.3