Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- base.buildNavigation = function() {
- if (base.options.buildNavigation && (base.pages > 1)) {
- base.$items.filter(':not(.cloned)').each(function(i,el) {
- var index = i + 1,
- klass = ((index == 1) ? 'first' : '') + ((index == base.pages) ? 'last' : ''),
- $a = $('<a href="#"></a>').addClass('panel' + index).wrap('<li class="' + klass + '" />');
- base.$nav.append($a.parent()); // use $a.parent() so IE will add <li> instead of only the <a> to the <ul>
- // If a formatter function is present, use it
- if ($.isFunction(base.options.navigationFormatter)) {
- var tmp = base.options.navigationFormatter(index, $(this));
- $a.html(tmp);
- // Add formatting to title attribute if text is hidden
- if (parseInt($a.css('text-indent'),10) < 0) { $a.addClass(base.options.tooltipClass).attr('title', tmp); }
- } else {
- $a.text(index);
- }
- $a.bind(base.options.clickControls, function(e) {
- if (!base.flag && base.options.enableNavigation) {
- // prevent running functions twice (once for click, second time for focusin)
- base.flag = true; setTimeout(function(){ base.flag = false; }, 100);
- base.gotoPage(index);
- if (base.options.hashTags) { base.setHash(index); }
- }
- e.preventDefault();
- });
- });
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement