← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3794: minor fixes

 

------------------------------------------------------------
revno: 3794
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-05-30 21:06:27 +0200
message:
  minor fixes
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisAjaxSelect.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-30 14:08:57 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisAjaxSelect.js	2011-05-30 19:06:27 +0000
@@ -110,7 +110,7 @@
 
     if ($ghost_target.size() === 0) {
         $ghost_target = $('<select id="' + ghost_target_id + '" multiple="multiple"></select>');
-// $ghost_target.hide();
+        $ghost_target.hide();
         $ghost_target.appendTo('body');
     }
 
@@ -176,11 +176,6 @@
     });
 
     dhisAjaxSelect_moveSorted($target, $(ghost_array));
-
-    // TODO temporary hack...
-    function comp(a, b) { return (a.innerHTML > b.innerHTML) ? 1 : -1; }
-    $target.html( $target.children().sort(comp) );
-    // end
 }
 
 /**
@@ -258,14 +253,6 @@
         {
             var $select = $("#" + select_id);
             var settings = $select.data("settings");
-            var params = settings.params;
-
-            var id = $select.attr("id");
-            var wrapper_id = id + "_wrapper";
-            $wrapper = $("#" + wrapper_id);
-            var filter_input_id = id + "_filter_input";
-            var $filter_input = $("#" + filter_input_id);
-            var filter_select_id = id + "_filter_select";
 
             $.post(settings.source, $.param(settings.params), function(json)
             {
@@ -288,6 +275,14 @@
                         });
                     }
                 }
+
+                // TODO temporary hack...
+                function comp(a, b) {
+                    return (a.innerHTML > b.innerHTML) ? 1 : -1;
+                }
+
+                $select.html( $select.children().sort(comp) );
+                // end
             });
         },
         init : function(options)