Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made variable names introduced in knadh/tinytabs@944f2e5

consistent with the rest of the lib (camelCase to underscores)
  • Loading branch information...
commit 63b755dbd045c0f839675a8fcb9a7e7cbaf7df0b 1 parent a7abf34
@knadh authored
Showing with 11 additions and 10 deletions.
  1. +10 −9 src/jquery.tinytabs.js
  2. +1 −1  src/jquery.tinytabs.min.js
View
19 src/jquery.tinytabs.js
@@ -72,9 +72,9 @@
}
}
- // get the title in a tab
- function getTitle($section) {
- return $section.find('.' + options.title_class + ':first')
+ // get the title element of a section
+ function getTitle(section) {
+ return section.find('.' + options.title_class + ':first');
}
// activate a tab
@@ -87,13 +87,14 @@
reset();
- var newTab = tabs.find('.tab-' + id).addClass('sel'),
- newSection = sections[id],
- title = getTitle($(newSection)).html();
+ var new_tab = tabs.find('.tab-' + id).addClass('sel'),
+ new_section = sections[id],
+ title = getTitle(new_section).html();
- options.before && options.before(newTab, title);
- newSection.show();
- options.after && options.after(newTab, title);
+ // before and after callbacks
+ options.before && options.before(new_tab, title);
+ new_section.show();
+ options.after && options.after(new_tab, title);
if(options.anchor) {
document.location.href = '#tab-' + id;
View
2  src/jquery.tinytabs.min.js
@@ -7,4 +7,4 @@
License : MIT License
*/
-(function(a){a.fn.tinytabs=function(b){function i(){d.children().removeClass("sel");a.each(f,function(){this.hide()})}function h(a){if(f[a]){var b=f[a]}else{return false}i();d.find(".tab-"+a).addClass("sel");f[a].show();if(c.anchor){document.location.href="#tab-"+a}return true}function g(){d=a("<ul>").attr("class",c.tabs_class);e.addClass("tinytabs").prepend(d);e.find(" ."+c.section_class).each(function(){var b=a(this),e=a(this).attr("id"),g=a(this).find("."+c.title_class+":first");if(!e)return true;f[e]=b;c.hide_title?g.hide():null;a(d).append(a("<li>").addClass(c.tab_class+" tab-"+e).append(a("<a>").html(g.html()).attr("href","#tab-"+e).click(function(){h(e);return c.anchor})))});a(d).append(a("<li>").addClass("clear"));var b=document.location.hash.replace("#tab-","");if(c.anchor&&b&&h(b)){}else{for(var g in f){h(g);break}}}var c={anchor:true,hide_title:true,section_class:"section",tabs_class:"tabs",tab_class:"tab",title_class:"title"};var d=null,e=this,f={};if(b){a.extend(c,b)}g();return this}})(jQuery)
+(function(a){a.fn.tinytabs=function(b){function j(){d.children().removeClass("sel");a.each(f,function(){this.hide()})}function i(a){if(f[a]){var b=f[a]}else{return false}j();var e=d.find(".tab-"+a).addClass("sel"),g=f[a],i=h(g).html();c.before&&c.before(e,i);g.show();c.after&&c.after(e,i);if(c.anchor){document.location.href="#tab-"+a}return true}function h(a){return a.find("."+c.title_class+":first")}function g(){d=a("<ul>").attr("class",c.tabs_class);e.addClass("tinytabs").prepend(d);e.find(" ."+c.section_class).each(function(){var b=a(this),e=b.attr("id"),g=h(b);if(!e)return true;f[e]=b;c.hide_title?g.hide():null;a(d).append(a("<li>").addClass(c.tab_class+" tab-"+e).append(a("<a>").html(g.html()).attr("href","#tab-"+e).click(function(){i(e);return c.anchor})))});a(d).append(a("<li>").addClass("clear"));var b=document.location.hash.replace("#tab-","");if(c.anchor&&b&&i(b)){}else{for(var g in f){i(g);break}}}var c={anchor:true,hide_title:true,section_class:"section",tabs_class:"tabs",tab_class:"tab",title_class:"title"};var d=null,e=this,f={};if(b){a.extend(c,b)}g();return this}})(jQuery)
Please sign in to comment.
Something went wrong with that request. Please try again.