=== 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 2013-11-28 10:34:47 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js 2013-12-08 22:26:19 +0000 @@ -1857,38 +1857,43 @@ $.getJSON( '../api/system/tasks/' + category + param, function( notifications ) { - var html = '', - isComplete = false; + var html = '', + isComplete = false; - if ( isDefined( notifications ) && notifications.length ) - { + if ( isDefined( notifications ) && notifications.length ) { $.each( notifications, function( i, notification ) { var first = i == 0, loaderHtml = ''; - if( notification.completed === "true" || notification.completed === true ) { - isComplete = true; - } - - if ( first ) - { + if ( first ) { $( '#' + tableId ).prop( 'lastUid', notification.uid ); loaderHtml = _loading_bar_html; $( '#loaderSpan' ).replaceWith ( '' ); // Hide previous loader bar } - var time = ( undefined != notification.time ) ? notification.time.replace( 'T', ' ' ).substring( 0, 19 ) : ''; + var time = ''; + + if ( undefined !== notification.time ) { + time = notification.time.replace( 'T', ' ' ).substring( 0, 19 ); + } html += '' + time + '' + notification.message + '  '; - html += isComplete ? '' : loaderHtml; + + if ( notification.completed ) { + html += ''; + isComplete = true; + } + else { + html += loaderHtml; + } + html += ''; } ); $( '#' + tableId ).show().prepend( html ); - if ( isComplete && completedCallback && completedCallback.call ) - { + if ( isComplete && completedCallback && completedCallback.call ) { completedCallback(); } }