diff options
author | robocoder <anthon.pang@gmail.com> | 2010-09-05 07:30:32 +0400 |
---|---|---|
committer | robocoder <anthon.pang@gmail.com> | 2010-09-05 07:30:32 +0400 |
commit | 433fae484affc8ec80872cf56417bcbee57bd455 (patch) | |
tree | e4bdd46ad96acb4991206f6e43104516712d339e /libs/jquery | |
parent | 20de337a6d4c203cdc53d962544907e3cef671bb (diff) |
refs #1634 - use .length to check result of .find()
git-svn-id: http://dev.piwik.org/svn/trunk@3058 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'libs/jquery')
-rw-r--r-- | libs/jquery/superfish_modified.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/libs/jquery/superfish_modified.js b/libs/jquery/superfish_modified.js index f4a2a3e9fe..5df74bb3b2 100644 --- a/libs/jquery/superfish_modified.js +++ b/libs/jquery/superfish_modified.js @@ -19,9 +19,9 @@ //begin piwik click = function(){ var $$ = $(this); - if($$.find('ul li').size() == 0) { + if($$.find('ul li').length == 0) { sf.currentActiveMenu = $$.parents('li'); - if(sf.currentActiveMenu.size() == 0) { + if(sf.currentActiveMenu.length == 0) { sf.currentActiveMenu = $$; } } else { @@ -125,18 +125,19 @@ var o = sf.op, not = (o.retainPath===true) ? o.$path : ''; o.retainPath = false; - var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not) // piwik - .find('>ul').hide().css('visibility','hidden'); - o.onHide.call($ul); + var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).find('>ul'); + if($ul.length){ + $ul.hide().css('visibility','hidden'); + o.onHide.call($ul); + } return this; }, showSuperfishUl : function(){ var o = sf.op, sh = sf.c.shadowClass+'-off', - $ul = this.addClass(o.hoverClass); - if($ul){ - $ul = $ul.find('>ul:hidden'); - if($ul) $ul.css('visibility','visible'); + $ul = this.addClass(o.hoverClass).find('>ul:hidden'); + if($ul.length){ + $ul.css('visibility','visible'); } sf.IE7fix.call($ul); |