← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16099: Using fading for header messages

 

------------------------------------------------------------
revno: 16099
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2014-07-12 13:33:56 +0200
message:
  Using fading for header messages
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataSetReport.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/css/widgets.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css	2014-07-12 08:30:29 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css	2014-07-12 11:33:56 +0000
@@ -360,9 +360,9 @@
   border-radius: 3px;
 }
 
-div#headerMessage
+#headerMessage
 {
-  top: 0px;
+  top: 3px;
   left: 155px;
   position: fixed;
   display: none;

=== 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	2014-05-05 09:21:46 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2014-07-12 11:33:56 +0000
@@ -231,7 +231,7 @@
  */
 function hideById( id )
 {
-  jQuery("#" + id).hide();
+    jQuery("#" + id).hide();
 }
 
 /**
@@ -241,7 +241,7 @@
  */
 function showById( id )
 {
-  jQuery("#" + id).show();
+    jQuery("#" + id).show();
 }
 
 /**
@@ -611,8 +611,8 @@
 {
 	if ( message && message != '' )
 	{
-		byId( 'message' ).innerHTML = message;
-		byId( 'message' ).style.display = 'block';
+		$( '#message' ).html( message );
+		$( '#message' ).show();
 	}
 }
 
@@ -632,7 +632,7 @@
  */
 function hideMessage()
 {
-	byId( 'message' ).style.display = 'none';
+	$( '#message' ).hide();
 }
 
 /**
@@ -644,11 +644,11 @@
 {
 	window.clearTimeout( headerMessageTimeout );
 	
-    $( 'div#headerMessage' ).html( message );
+    $( '#headerMessage' ).html( message );
     
     if ( isHeaderMessageHidden() )
     {
-    	$( 'div#headerMessage' ).slideDown( 'fast' );
+    	$( '#headerMessage' ).fadeIn( 'fast' );
     }
 }
 
@@ -666,7 +666,7 @@
 	
 	if ( isHeaderMessageHidden() )
 	{
-    	$( 'div#headerMessage' ).slideDown( 'fast' );
+    	$( 'div#headerMessage' ).fadeIn( 'fast' );
 	}
 }
 
@@ -699,7 +699,7 @@
  */
 function hideHeaderMessage()
 {
-    $( 'div#headerMessage' ).slideUp( 'fast' );
+    $( '#headerMessage' ).fadeOut( 'fast' );
 }   
 
 /**
@@ -707,7 +707,7 @@
  */
 function isHeaderMessageVisible()
 {
-    return $( 'div#headerMessage' ).is(":visible");
+    return $( '#headerMessage' ).is( ":visible" );
 }
 
 /**
@@ -726,7 +726,7 @@
 function setInfo( message )
 {
     $( '#info' ).html( message );
-    $( '#info' ).slideDown( 'fast' );
+    $( '#info' ).fadeIn( 'fast' );
 }
 
 /**
@@ -734,7 +734,7 @@
  */
 function hideInfo()
 {
-    $( '#info' ).slideUp( 'fast' );
+    $( '#info' ).fadeOut( 'fast' );
 }
 
 /**
@@ -760,7 +760,7 @@
  */
 function showWarning()
 {
-    $( '#warningArea' ).show( "fast" );
+    $( '#warningArea' ).show();
 }
 
 /**
@@ -768,7 +768,7 @@
  */
 function hideWarning()
 {
-    $( '#warningArea' ).hide( "fast" );
+    $( '#warningArea' ).hide();
 }
 
 /**
@@ -778,9 +778,13 @@
  */
 function byId( elementId )
 {
-  return document.getElementById( elementId );
+    return document.getElementById( elementId );
 }
 
+// -----------------------------------------------------------------------------
+// Supportive functions
+// -----------------------------------------------------------------------------
+
 /**
  * Toggles visibility for an element.
  * 
@@ -1324,7 +1328,8 @@
  * 
  * @return Validation rules for a given form
  */
-function getValidationRules( form ) {
+function getValidationRules( form ) 
+{
 	if ( form !== undefined ) {
 		return validationRules[form];
 	}

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js	2014-06-24 16:36:24 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js	2014-07-12 11:33:56 +0000
@@ -128,17 +128,17 @@
 	
 	if ( !dataReport.ds )
     {
-        setHeaderMessage( i18n_select_data_set );
+		setHeaderDelayMessage( i18n_select_data_set );
         return false;
     }
     if ( !dataReport.pe )
     {
-        setHeaderMessage( i18n_select_period );
+    	setHeaderDelayMessage( i18n_select_period );
         return false;
     }
     if ( !selection.isSelected() )
     {
-        setHeaderMessage( i18n_select_organisation_unit );
+    	setHeaderDelayMessage( i18n_select_organisation_unit );
         return false;
     }
 

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataSetReport.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataSetReport.js	2014-06-25 15:56:22 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataSetReport.js	2014-07-12 11:33:56 +0000
@@ -186,17 +186,17 @@
 {	
     if ( !dataSetReport.ds )
     {
-        setHeaderMessage( i18n_select_data_set );
+    	setHeaderDelayMessage( i18n_select_data_set );
         return false;
     }
     if ( !dataSetReport.pe )
     {
-        setHeaderMessage( i18n_select_period );
+    	setHeaderDelayMessage( i18n_select_period );
         return false;
     }
     if ( !selectionTreeSelection.isSelected() )
     {
-        setHeaderMessage( i18n_select_organisation_unit );
+    	setHeaderDelayMessage( i18n_select_organisation_unit );
         return false;
     }