← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11969: Minor fix.

 

------------------------------------------------------------
revno: 11969
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2013-09-08 16:12:12 +0700
message:
  Minor fix.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.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-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm	2013-09-06 15:53:07 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm	2013-09-08 09:12:12 +0000
@@ -78,10 +78,13 @@
 
 <table id='entryPostComment' class='listTable hidden' style="width:100%;">
 <tr>
-	<th><label for="postComment">$i18n.getString('post_comment'):</label>
-		<input type="text" class="{validate:{maxlength:160}} criteria" id="commentInput" name='commentInput'
-			style="width:85%" onkeypress="keypressOnComment( event, this );" >
-		<input id="commentButton" name='commentButton' type="button" style='width:40px' value="$i18n.getString('add')" onclick='addComment( byId("commentInput"), $programStageInstance.id )'>
+	<th width="10%"><label for="postComment">$i18n.getString('post_comment'):</label></th>
+	<th width="85%">
+		<textarea type="text" class="criteria" id="commentInput" name='commentInput'
+			style="width:100%;height:12px;" onkeyup='commentKeyup()'></textarea>
+	</th>
+	<th width="5%">
+		<input id="commentButton" name='commentButton' type="button" style='width:40px;' value="$i18n.getString('add')" onclick='addComment( byId("commentInput"), $programStageInstance.id )'>
 	</th>
 </tr>
 </table>
@@ -124,4 +127,5 @@
 			disable('validateBtn');
 		}
 	}
+	
 </script>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2013-09-07 21:25:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2013-09-08 09:12:12 +0000
@@ -2028,6 +2028,13 @@
 	}
 }
 
+function commentKeyup(){
+	var commentInput = byId('commentInput');
+	while($(commentInput).outerHeight() < commentInput.scrollHeight + parseFloat($(commentInput).css("borderTopWidth")) + parseFloat($(commentInput).css("borderBottomWidth"))) {
+		$(commentInput).height($(commentInput).height()+10);
+	};
+}
+
 function removeMessage(programInstanceId, programStageInstanceId, smsId )
 {
 	var result = window.confirm( i18n_confirmation_delete_message);

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2013-09-06 15:53:07 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2013-09-08 09:12:12 +0000
@@ -804,12 +804,13 @@
             $( "#entryFormContainer input[id='currentUsername']" ).val( data.currentUsername );
             $( "#entryFormContainer input[id='blockEntryForm']" ).val( data.programStage.blockEntryForm );
             $( "#entryFormContainer input[id='remindCompleted']" ).val( data.programStage.remindCompleted );
-			$( "#entryFormContainer input[id='commentInput']" ).val( data.comment );
 			$( "#entryFormContainer input[id='displayOptionSetAsRadioButton']" ).val( data.displayOptionSetAsRadioButton );
 
             $( "input[id='dueDate']" ).val( data.dueDate );
             $( "input[id='executionDate']" ).val( data.executionDate );
-
+			$( "#commentInput" ).val( data.comment );
+			$( "#commentInput" ).height(data.comment.split('\n').length * 15  + 12);
+			
             if ( data.program.type != '1' ) {
                 hideById( 'newEncounterBtn' );
             }