=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js 2012-04-11 20:16:18 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js 2012-04-11 20:40:12 +0000
@@ -1593,20 +1593,25 @@
function pingNotifications( category, tableId, completedCallback )
{
- var lastUid = $( '#' + tableId ).prop( 'lastUid' );
+ var lastUid = $( '#' + tableId ).prop( 'lastUid' ); // Store on table property
var param = lastUid ? '&lastUid=' + lastUid : '';
$.getJSON( '../dhis-web-commons-ajax-json/getNotifications.action?category=' + category + param, function( json )
{
var html = '';
- var completedHtml = '';
+ var isComplete = false;
$.each( json.notifications, function( i, notification )
{
var first = i == 0;
var loaderHtml = '';
+ if ( notification.completed == "true" )
+ {
+ isComplete = true;
+ }
+
if ( first )
{
$( '#' + tableId ).prop( 'lastUid', notification.uid );
@@ -1615,15 +1620,15 @@
}
html += '
' + notification.time + ' | ' + notification.message + ' ';
- html += notification.completed == "true" ? completedHtml : loaderHtml;
+ html += isComplete ? '' : loaderHtml;
html += ' |
';
-
- if ( notification.completed && completedCallback && completedCallback.call )
- {
- completedCallback();
- }
} );
$( '#' + tableId ).prepend( html );
+
+ if ( isComplete && completedCallback && completedCallback.call )
+ {
+ completedCallback();
+ }
} );
}
=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/importDataValue.js'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/importDataValue.js 2012-04-11 20:16:18 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/importDataValue.js 2012-04-11 20:40:12 +0000
@@ -14,18 +14,19 @@
function pingNotificationsTimeout()
{
- pingNotifications( 'DATAVALUE_IMPORT', 'notificationTable', displayImportSummaryTimeout );
+ pingNotifications( 'DATAVALUE_IMPORT', 'notificationTable', displaySummaryLink );
pingTimeout = setTimeout( "pingNotificationsTimeout()", 1500 );
}
-function displayImportSummaryTimeout()
+function displaySummaryLink()
{
- setTimeout( "displayImportSummary()", 2000 );
+ window.clearTimeout( pingTimeout );
+ var html = ' | Display import summary |
';
+ $( '#notificationTable' ).prepend( html );
}
-function displayImportSummary()
+function displaySummary()
{
- window.clearTimeout( pingTimeout );
$( '#notificationDiv' ).hide();
- $( '#importSummaryDiv' ).show().load( 'getDataValueImportSummary.action' );
+ $( '#importSummaryDiv' ).show( 'slow' ).load( 'getDataValueImportSummary.action' );
}
\ No newline at end of file