]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
jslinted ui.js
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 9 Nov 2010 00:50:31 +0000 (00:50 +0000)
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 9 Nov 2010 00:50:31 +0000 (00:50 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7263 36083f99-b078-4883-b0ff-0f9b5a30f544

js/lib/ui.js

index 4a9c64e703f370e65c66ae10a288f1b1e7b14cf1..c079abda25b72de0c3ebfbd41b51cd110be0986c 100644 (file)
@@ -43,7 +43,7 @@ elgg.ui.toggleCollapsibleBox = function () {
                        var root = this, zIndex = 5000;\r
                \r
                        function getSubnav(ele) {\r
-                               if (ele.nodeName.toLowerCase() == 'li') {\r
+                               if (ele.nodeName.toLowerCase() === 'li') {\r
                                        var subnav = $('> ul', ele);\r
                                        return subnav.length ? subnav[0] : null;\r
                                } else {\r
@@ -52,7 +52,7 @@ elgg.ui.toggleCollapsibleBox = function () {
                        }\r
                \r
                        function getActuator(ele) {\r
-                               if (ele.nodeName.toLowerCase() == 'ul') {\r
+                               if (ele.nodeName.toLowerCase() === 'ul') {\r
                                        return $(ele).parents('li')[0];\r
                                } else {\r
                                        return ele;\r
@@ -74,17 +74,19 @@ elgg.ui.toggleCollapsibleBox = function () {
                        }\r
                \r
                        function show() {\r
-                               var subnav = getSubnav(this);\r
+                               var subnav = getSubnav(this), li;\r
+                               \r
                                if (!subnav) {\r
                                        return;\r
                                }\r
                                \r
                                $.data(subnav, 'cancelHide', true);\r
                                \r
-                               $(subnav).css({zIndex: zIndex++}).slideDown(options.speed);\r
+                               $(subnav).css({zIndex: zIndex}).slideDown(options.speed);\r
+                               zIndex++;\r
                                \r
-                               if (this.nodeName.toLowerCase() == 'ul') {\r
-                                       var li = getActuator(this);\r
+                               if (this.nodeName.toLowerCase() === 'ul') {\r
+                                       li = getActuator(this);\r
                                        $(li).addClass('hover');\r
                                        $('> a', li).addClass('hover');\r
                                }\r
@@ -92,8 +94,14 @@ elgg.ui.toggleCollapsibleBox = function () {
                \r
                        $('ul, li', this).hover(show, hide);\r
                        $('li', this).hover(\r
-                               function() { $(this).addClass('hover'); $('> a', this).addClass('hover'); },\r
-                               function() { $(this).removeClass('hover'); $('> a', this).removeClass('hover'); }\r
+                               function () { \r
+                                       $(this).addClass('hover');\r
+                                       $('> a', this).addClass('hover');\r
+                               },\r
+                               function () { \r
+                                       $(this).removeClass('hover');\r
+                                       $('> a', this).removeClass('hover');\r
+                               }\r
                        );\r
                \r
                });\r
@@ -102,8 +110,8 @@ elgg.ui.toggleCollapsibleBox = function () {
        //Make delimited list\r
        $.fn.makeDelimitedList = function(elementAttribute) {\r
        \r
-               var delimitedListArray = [];\r
-               var listDelimiter = "::";\r
+               var delimitedListArray = []\r
+                       listDelimiter = "::";\r
        \r
                // Loop over each element in the stack and add the elementAttribute to the array\r
                this.each(function(e) {\r
@@ -114,7 +122,7 @@ elgg.ui.toggleCollapsibleBox = function () {
                );\r
        \r
                // Return value list by joining the array\r
-               return(delimitedListArray.join(listDelimiter));\r
+               return delimitedListArray.join(listDelimiter);\r
        };\r
 })(jQuery);\r
 \r