aboutsummaryrefslogtreecommitdiffstats
path: root/ui/ui.tabs.js
diff options
context:
space:
mode:
authorKlaus Hartl <klaus.hartl@googlemail.com>2009-02-14 15:56:44 +0000
committerKlaus Hartl <klaus.hartl@googlemail.com>2009-02-14 15:56:44 +0000
commit26f1b0330f26a64e29a3f9cdec5f1d879907bfdd (patch)
treef874a7c752b2d9bddd6f35262b30f6c5d39297ec /ui/ui.tabs.js
parentf869dab6b00f32cb598457261d4d9c369ff04dc5 (diff)
downloadjquery-ui-26f1b0330f26a64e29a3f9cdec5f1d879907bfdd.tar.gz
jquery-ui-26f1b0330f26a64e29a3f9cdec5f1d879907bfdd.zip
Tabs: using closest() is shorter
Diffstat (limited to 'ui/ui.tabs.js')
-rw-r--r--ui/ui.tabs.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/ui/ui.tabs.js b/ui/ui.tabs.js
index 51a818b43..3208d60b5 100644
--- a/ui/ui.tabs.js
+++ b/ui/ui.tabs.js
@@ -208,7 +208,7 @@ $.widget("ui.tabs", {
handleState('hover', $(this));
});
this.$tabs.bind('focus.tabs blur.tabs', function() {
- handleState('focus', $(this).parents('li:first'));
+ handleState('focus', $(this).closest('li'));
});
}
@@ -267,9 +267,8 @@ $.widget("ui.tabs", {
// attach tab event handler, unbind to avoid duplicates from former tabifying...
this.$tabs.bind(o.event + '.tabs', function() {
- var $li = $(this).parents('li:eq(0)'),
- $hide = self.$panels.filter(':visible'),
- $show = $(self._sanitizeSelector(this.hash));
+ var $li = $(this).closest('li'), $hide = self.$panels.filter(':visible'),
+ $show = $(self._sanitizeSelector(this.hash));
// If tab is already selected and not collapsible or tab disabled or
// or is already loading or click callback returns false stop here.