diff options
| author | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-09 00:50:31 +0000 | 
|---|---|---|
| committer | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-09 00:50:31 +0000 | 
| commit | 08cd6c97989e3485ae30ec895b2fd7e6d7a3d007 (patch) | |
| tree | 457d49e27c936f08bb5cd00b4fe05530a0309f7d /js/lib | |
| parent | a029ab8eb677ea075267fefaaa61fcf1fa484956 (diff) | |
| download | elgg-08cd6c97989e3485ae30ec895b2fd7e6d7a3d007.tar.gz elgg-08cd6c97989e3485ae30ec895b2fd7e6d7a3d007.tar.bz2 | |
jslinted ui.js
git-svn-id: http://code.elgg.org/elgg/trunk@7263 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'js/lib')
| -rw-r--r-- | js/lib/ui.js | 30 | 
1 files changed, 19 insertions, 11 deletions
| diff --git a/js/lib/ui.js b/js/lib/ui.js index 4a9c64e70..c079abda2 100644 --- a/js/lib/ui.js +++ b/js/lib/ui.js @@ -43,7 +43,7 @@ elgg.ui.toggleCollapsibleBox = function () {  			var root = this, zIndex = 5000;
  			function getSubnav(ele) {
 -				if (ele.nodeName.toLowerCase() == 'li') {
 +				if (ele.nodeName.toLowerCase() === 'li') {
  					var subnav = $('> ul', ele);
  					return subnav.length ? subnav[0] : null;
  				} else {
 @@ -52,7 +52,7 @@ elgg.ui.toggleCollapsibleBox = function () {  			}
  			function getActuator(ele) {
 -				if (ele.nodeName.toLowerCase() == 'ul') {
 +				if (ele.nodeName.toLowerCase() === 'ul') {
  					return $(ele).parents('li')[0];
  				} else {
  					return ele;
 @@ -74,17 +74,19 @@ elgg.ui.toggleCollapsibleBox = function () {  			}
  			function show() {
 -				var subnav = getSubnav(this);
 +				var subnav = getSubnav(this), li;
 +				
  				if (!subnav) {
  					return;
  				}
  				$.data(subnav, 'cancelHide', true);
 -				$(subnav).css({zIndex: zIndex++}).slideDown(options.speed);
 +				$(subnav).css({zIndex: zIndex}).slideDown(options.speed);
 +				zIndex++;
 -				if (this.nodeName.toLowerCase() == 'ul') {
 -					var li = getActuator(this);
 +				if (this.nodeName.toLowerCase() === 'ul') {
 +					li = getActuator(this);
  					$(li).addClass('hover');
  					$('> a', li).addClass('hover');
  				}
 @@ -92,8 +94,14 @@ elgg.ui.toggleCollapsibleBox = function () {  			$('ul, li', this).hover(show, hide);
  			$('li', this).hover(
 -				function() { $(this).addClass('hover'); $('> a', this).addClass('hover'); },
 -				function() { $(this).removeClass('hover'); $('> a', this).removeClass('hover'); }
 +				function () { 
 +					$(this).addClass('hover');
 +					$('> a', this).addClass('hover');
 +				},
 +				function () { 
 +					$(this).removeClass('hover');
 +					$('> a', this).removeClass('hover');
 +				}
  			);
  		});
 @@ -102,8 +110,8 @@ elgg.ui.toggleCollapsibleBox = function () {  	//Make delimited list
  	$.fn.makeDelimitedList = function(elementAttribute) {
 -		var delimitedListArray = [];
 -		var listDelimiter = "::";
 +		var delimitedListArray = [], 
 +			listDelimiter = "::";
  		// Loop over each element in the stack and add the elementAttribute to the array
  		this.each(function(e) {
 @@ -114,7 +122,7 @@ elgg.ui.toggleCollapsibleBox = function () {  		);
  		// Return value list by joining the array
 -		return(delimitedListArray.join(listDelimiter));
 +		return delimitedListArray.join(listDelimiter);
  	};
  })(jQuery);
 | 
