dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17133
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6722: Data entry, fixed bug, completeness div not displayed in offline mode
------------------------------------------------------------
revno: 6722
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-04-24 15:15:29 +0200
message:
Data entry, fixed bug, completeness div not displayed in offline mode
modified:
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.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-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2012-03-26 18:11:26 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2012-04-24 13:15:29 +0000
@@ -675,7 +675,13 @@
organisationUnitId : currentOrganisationUnitId
},
dataType: 'json',
- success: function( json )
+ error: function() // offline
+ {
+ $( '#contentDiv' ).show();
+ $( '#completenessDiv' ).show();
+ $( '#infoDiv' ).hide();
+ },
+ success: function( json ) // online
{
if ( json.locked )
{
@@ -690,8 +696,7 @@
$( '#completenessDiv' ).show();
}
- // Set data values, works for select lists too as data
- // value = select value
+ // Set data values, works for selects too as data value=select value
$.each( json.dataValues, function( i, value )
{
@@ -740,7 +745,7 @@
if ( json.storedBy )
{
- $( '#infoDiv' ).css( 'display', 'block' );
+ $( '#infoDiv' ).show();
$( '#completedBy' ).html( json.storedBy );
$( '#completedDate' ).html( json.date );
@@ -751,7 +756,7 @@
{
$( '#completeButton' ).removeAttr( 'disabled' );
$( '#undoButton' ).attr( 'disabled', 'disabled' );
- $( '#infoDiv' ).css( 'display', 'none' );
+ $( '#infoDiv' ).hide();
}
}
} );