From 0cd0cf9a29052115b77a1c0765eaf5eefb63440b Mon Sep 17 00:00:00 2001 From: benakamoorthi <benaka.moorthi@gmail.com> Date: Sat, 13 Oct 2012 16:56:03 +0000 Subject: [PATCH] Refs #1823, fade 'Done' in & out after successfully switched location providers. git-svn-id: http://dev.piwik.org/svn/trunk@7181 59fd770c-687e-43c8-a1e3-f5a4ff64c105 --- plugins/UserCountry/templates/admin.js | 9 ++++++++- plugins/UserCountry/templates/adminIndex.tpl | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/UserCountry/templates/admin.js b/plugins/UserCountry/templates/admin.js index ad93d52594..0acc247984 100755 --- a/plugins/UserCountry/templates/admin.js +++ b/plugins/UserCountry/templates/admin.js @@ -10,7 +10,9 @@ $(document).ready(function() { $('.current-location-provider').change(function() { if (!$(this).is(':checked')) return; // only handle radio buttons that get checked - var loading = $('.loadingPiwik', $(this).parent()); + var parent = $(this).parent(), + loading = $('.loadingPiwik', parent), + ajaxSuccess = $('.ajaxSuccess', parent); loading.show(); $.ajax({ @@ -26,6 +28,11 @@ $(document).ready(function() { error: piwikHelper.ajaxHandleError, // Callback when the request fails success: function() { loading.hide(); + ajaxSuccess.fadeIn(1000, function() { + setTimeout(function() { + ajaxSuccess.fadeOut(1000); + }, 500); + }); } }); }); diff --git a/plugins/UserCountry/templates/adminIndex.tpl b/plugins/UserCountry/templates/adminIndex.tpl index ba7edcd7b9..1d8eb9236b 100755 --- a/plugins/UserCountry/templates/adminIndex.tpl +++ b/plugins/UserCountry/templates/adminIndex.tpl @@ -21,6 +21,7 @@ <input class="current-location-provider" name="current-location-provider" value="{$id}" type="radio" {if $currentProviderId eq $id}checked="checked"{/if} id="provider_input_{$id}" style="cursor:pointer" {if $provider.status neq 1}disabled="disabled"{/if}/> <label for="provider_input_{$id}" style="font-size:1.2em">{$provider.title|translate}</label><br/> <span class='loadingPiwik' style='display:none'><img src='./themes/default/images/loading-blue.gif' /></span> + <span class="ajaxSuccess" style='display:none'>{'General_Done'|translate}</span> </p> <p style="margin-left:.5em"> <strong><em> -- GitLab