← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3809: implemented basic loading animation for ajaxSelect

 

------------------------------------------------------------
revno: 3809
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-05-31 14:52:15 +0200
message:
  implemented basic loading animation for ajaxSelect
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisAjaxSelect.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/viewDataEntryForm.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/jQuery/jquery.dhisAjaxSelect.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisAjaxSelect.js	2011-05-31 11:26:04 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisAjaxSelect.js	2011-05-31 12:52:15 +0000
@@ -160,6 +160,10 @@
             var $select = $("#" + select_id);
             var settings = $select.data("settings");
 
+            var loader_id = select_id + '_loader';
+            var $loader = $('#' + loader_id); 
+            $loader.css('visibility', 'visible');
+
             $.post(settings.source, $.param(settings.params), function(json)
             {
                 $select.empty();
@@ -181,6 +185,8 @@
                         });
                     }
                 }
+
+                $loader.css('visibility', 'hidden');
             });
         },
         init : function(options)
@@ -290,6 +296,10 @@
 
             var $filter_input = $("#" + filter_input_id);
             var $filter_button = $("#" + filter_button_id);
+            
+            var loader_id = id + '_loader';
+            $('<img id="' + loader_id + '" src="../images/ajax-loader-bar.gif" />').insertAfter($wrapper);
+            $('#' + loader_id).css('visibility', 'hidden');
 
             settings.params = params;
             $select.data("settings", settings);

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/viewDataEntryForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/viewDataEntryForm.js	2011-05-28 21:04:47 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/viewDataEntryForm.js	2011-05-31 12:52:15 +0000
@@ -20,8 +20,8 @@
 		var indicatorSelector = $("#indicatorSelector");
 		var dataElementSelector = $("#dataElementSelector");
 
-		dataElementSelector.height( dialog.height() - 78 );
-		indicatorSelector.height( dialog.height() - 78 );
+		dataElementSelector.height( dialog.height() - 93 );
+		indicatorSelector.height( dialog.height() - 93 );
 	});
 
 	$(":button").button();