← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11926: fixes bugs in pingNotifications

 

------------------------------------------------------------
revno: 11926
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-09-05 11:24:48 +0200
message:
  fixes bugs in pingNotifications
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== 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-09-03 18:28:38 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2013-09-05 09:24:48 +0000
@@ -1830,20 +1830,19 @@
 	{
 		var html = '', 
 			isComplete = false;
-		
+
 		if ( isDefined( notifications ) && notifications.length )
 		{
 			$.each( notifications, function( i, notification )
 			{
 				var first = i == 0,
-					loaderHtml = '';			
-				
-				if ( notification.completed == "true" )
-				{
-					isComplete = true;
-				}
-				
-				if ( first )
+					loaderHtml = '';
+
+                if( notification.completed === "true" || notification.completed === true ) {
+                    isComplete = true;
+                }
+
+                if ( first )
 				{
 					$( '#' + tableId ).prop( 'lastUid', notification.uid );
 					loaderHtml = _loading_bar_html;
@@ -1853,7 +1852,7 @@
 				var time = ( undefined != notification.time ) ? notification.time.replace( 'T', ' ' ).substring( 0, 19 ) : '';
 				
 				html += '<tr><td>' + time + '</td><td>' + notification.message + ' &nbsp;';
-				html += notification.completed == 'true' ?  '<img src="../images/completed.png">' : loaderHtml;
+				html += isComplete ?  '<img src="../images/completed.png">' : loaderHtml;
 				html += '</td></tr>';
 			} );