moksha/api/widgets/containers/templates/tabbedcontainer_tabs.mak | 2 +-
moksha/api/widgets/selectable/templates/selectable.mak | 8 +++++---
moksha/public/javascript/ui/moksha.ui.tabs.js | 10 +++++++---
3 files changed, 13 insertions(+), 7 deletions(-)
New commits:
commit 6e240d4f1f9c4e111898d1de944c8ce3c3b8f869
Author: John (J5) Palmieri <johnp(a)redhat.com>
Date: Wed Apr 22 19:06:07 2009 -0400
make tab widget more presise when selecting elements
* We were picking up all li's instead of just the tab li's so we needed
to narrow our search from the whole widget to just the tab div
* when selecting a tab deselect from our list of li's instead of
deselecting from the newly selected tab's siblings. We do this
because tabs can span multiple ul's
diff --git a/moksha/api/widgets/containers/templates/tabbedcontainer_tabs.mak
b/moksha/api/widgets/containers/templates/tabbedcontainer_tabs.mak
index a3991ae..9e194d0 100644
--- a/moksha/api/widgets/containers/templates/tabbedcontainer_tabs.mak
+++ b/moksha/api/widgets/containers/templates/tabbedcontainer_tabs.mak
@@ -1,5 +1,5 @@
-<div id="${root_id}">
+<div id="${root_id}_tabs">
<%def name="display_category(cat)">
% if cat.get('label'):
<H4>${cat['label']}</H4>
diff --git a/moksha/api/widgets/selectable/templates/selectable.mak
b/moksha/api/widgets/selectable/templates/selectable.mak
index 12d03c6..0414525 100644
--- a/moksha/api/widgets/selectable/templates/selectable.mak
+++ b/moksha/api/widgets/selectable/templates/selectable.mak
@@ -1,12 +1,14 @@
<div class="links" id="${content_id}">
% for i, c in enumerate(categories):
- <h4>
+ % if c['label']:
+ <h4>
${c['label']}
- </h4>
+ </h4>
+ % endif
<ul>
% for j, item in enumerate(c['items']):
<li>
- <a id="${content_id}_${i}_${j}"
href="${item['link']}" >${item['label']}</a>
+ <a id="${content_id}_${i}_${j}"
href="javascript:moksha.goto('${item['link']}')"
>${item['label']}</a>
% if 'data' in item:
<script type="text/javascript">
<%
diff --git a/moksha/public/javascript/ui/moksha.ui.tabs.js
b/moksha/public/javascript/ui/moksha.ui.tabs.js
index 649624c..afa27df 100644
--- a/moksha/public/javascript/ui/moksha.ui.tabs.js
+++ b/moksha/public/javascript/ui/moksha.ui.tabs.js
@@ -61,7 +61,10 @@ $.widget("ui.mokshatabs", {
},
tabify: function(init) {
- this.$lis = $('ul li:has(>a[href])', this.element);
+ var tab_id = this.element.attr('id') + '_tabs';
+ this.$lis = $('#' + tab_id + ' ul li:has(>a[href])',
this.element);
+ console.log(this.$lis)
+ console.log(this.element);
this.$tabs = this.$lis.map(function() { return $('a', this)[0]; });
this.$panels = $([]);
@@ -263,8 +266,9 @@ $.widget("ui.mokshatabs", {
/*if (o.bookmarkable && trueClick) { // add to history only if true
click occured, not a triggered click
$.ajaxHistory.update(clicked.hash);
}*/
- $li.addClass(o.selectedClass)
- .siblings().removeClass(o.selectedClass);
+
+ self.$lis.removeClass(o.selectedClass);
+ $li.addClass(o.selectedClass);
hideTab(clicked, $hide, $show);
}
Show replies by date