From 11254054b880e9107e1f0d66100c6e67ffeb76b9 Mon Sep 17 00:00:00 2001 From: BeezyT <timo@ezdesign.de> Date: Mon, 23 May 2011 15:27:18 +0000 Subject: [PATCH] refs #2431 show loading feedback when clicking on sparklines git-svn-id: http://dev.piwik.org/svn/trunk@4790 59fd770c-687e-43c8-a1e3-f5a4ff64c105 --- plugins/CoreHome/templates/jqplot.css | 6 ++++++ plugins/CoreHome/templates/sparkline.js | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/CoreHome/templates/jqplot.css b/plugins/CoreHome/templates/jqplot.css index 1226be75dd..5a3d87fdfe 100644 --- a/plugins/CoreHome/templates/jqplot.css +++ b/plugins/CoreHome/templates/jqplot.css @@ -1,4 +1,10 @@ +.jqplot-loading { + background: url(../../../themes/default/images/loading-blue.gif) no-repeat center center white; + position: absolute; + z-index: 10; +} + .jqplot-tooltip { position: absolute; z-index: 2000; diff --git a/plugins/CoreHome/templates/sparkline.js b/plugins/CoreHome/templates/sparkline.js index 4b19d3d6e8..90775ce8ae 100644 --- a/plugins/CoreHome/templates/sparkline.js +++ b/plugins/CoreHome/templates/sparkline.js @@ -28,8 +28,17 @@ function initializeSparklines () { if (typeof $.jqplot == 'undefined') { piwikHelper.findSWFGraph(idDataTable + "Chart_swf").reload(url); } else { + var chart = $('#'+idDataTable+"Chart_swf"); + var loading = $(document.createElement('div')).addClass('jqplot-loading'); + loading.css({ + width: chart.innerWidth()+'px', + height: chart.innerHeight()+'px', + opacity: 0 + }); + chart.prepend(loading); + loading.css({opacity: .7}); $.get(url, {}, function(data) { - $('#'+idDataTable+"Chart_swf").trigger('replot', data).size(); + chart.trigger('replot', data).size(); }, 'json'); } piwikHelper.lazyScrollTo(graph[0], 400); -- GitLab