← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4167: minor fixes in ouwt

 

------------------------------------------------------------
revno: 4167
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-07-19 11:49:08 +0200
message:
  minor fixes in ouwt
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.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/ouwt/ouwt.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js	2011-07-19 09:32:47 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js	2011-07-19 09:49:08 +0000
@@ -71,13 +71,13 @@
                 $linkTag.addClass( "selected" );
             } else
             {
-                $.ajax({
-					type: "POST",
-					url: organisationUnitTreePath + "setorgunit.action?id=" + unitId,
-					dataType: "xml",
-					success: responseReceived
-				});
-				
+                $.ajax( {
+                    type : "POST",
+                    url : organisationUnitTreePath + "setorgunit.action?id=" + unitId,
+                    dataType : "xml",
+                    success : responseReceived
+                } );
+
                 $( "#orgUnitTree" ).find( "a" ).removeClass( "selected" );
                 $linkTag.addClass( "selected" );
             }
@@ -314,37 +314,21 @@
 
     function getToggleExpand()
     {
-        var imgTag = getToggleImage();
-        imgTag.src = '../images/colapse.png';
-        imgTag.alt = '[+]';
-        return imgTag;
+        return getToggleImage().attr( "src", "../images/colapse.png" ).attr( "alt", "[+]" );
     }
 
     function getToggleCollapse()
     {
-        var imgTag = getToggleImage();
-        imgTag.src = '../images/expand.png';
-        imgTag.width = '9';
-        imgTag.height = '9';
-        imgTag.alt = '[-]';
-        return imgTag;
+        return getToggleImage().attr( "src", "../images/expand.png" ).attr( "alt", "[-]" );
     }
 
     function getToggleBlank()
     {
-        var imgTag = getToggleImage();
-        imgTag.src = '../images/transparent.gif';
-        imgTag.width = '9';
-        imgTag.height = '9';
-        imgTag.alt = '';
-        return imgTag;
+        return getToggleImage().attr( "src", "../images/transparent.gif" ).attr( "alt", "" );
     }
 
     function getToggleImage()
     {
-        var imgTag = document.createElement( 'img' );
-        imgTag.width = '9';
-        imgTag.height = '9';
-        return imgTag;
+        return $( "<img/>" ).attr( "width", 9 ).attr( "height", 9 );
     }
 }