moksha/public/javascript/ui/moksha.ui.tabs.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-)
New commits: commit d8f85436e66ba414d83ee7b2ab024d67e4da86c9 Author: John (J5) Palmieri johnp@redhat.com Date: Thu Apr 23 17:01:20 2009 -0400
a better fix for the static vs. dynamic link indexing issue
* instead of going off relative indexes when showing and hiding panes we always use the id's so we are sure we are matching up the right panel to the right tab
* The issue only arises on first load because the selected tab's corrasponding panel is shown based on the position of the tab in the tab list. Since we don't bother to output static tab panels (they will never be populated) there can be less panels in the panel list than there are tabs in the tabs list so indexing is inacurrate.
* Clicking on a tab always used the id's to identify the correct panel so we use the same method on first load now.
diff --git a/moksha/public/javascript/ui/moksha.ui.tabs.js b/moksha/public/javascript/ui/moksha.ui.tabs.js index ad92011..5b05e8c 100644 --- a/moksha/public/javascript/ui/moksha.ui.tabs.js +++ b/moksha/public/javascript/ui/moksha.ui.tabs.js @@ -66,14 +66,6 @@ $.widget("ui.mokshatabs", {
this.$tabs = this.$lis.map(function() { return $('a', this)[0]; });
- // filter out static link list items after we have extracted their - // actual links. We still want to control the linking but $lis is - // used for mapping dynamic tabs to panels - this.$lis = this.$lis.map(function() { - if (!$('a', this).hasClass('static_link')) - return this; - } - ); this.$panels = $([]);
var self = this, o = this.options; @@ -203,9 +195,10 @@ $.widget("ui.mokshatabs", { this.$lis.removeClass(o.selectedClass); if (o.selected !== null) {
- - var p = this.$panels.eq(o.selected).show().removeClass(o.hideClass); // use show and remove class to show in any case no matter how it has been hidden before - this.$lis.eq(o.selected).addClass(o.selectedClass); + var l = this.$lis.eq(o.selected).addClass(o.selectedClass); + var a = $('a', l)[0]; + var $show = $(a.hash + ':first', self.element) + $show.show().removeClass(o.hideClass); // use show and remove class to show in any case no matter how it has been hidden before
// seems to be expected behavior that the show callback is fired var onShow = function() {
moksha-commits@lists.fedorahosted.org