wesnolte / Pajinate

A jQuery Pagination Plugin
http://th3silverlining.com/2010/04/15/pajination-a-jquery-pagination-plugin/
MIT License
207 stars 97 forks source link

first_link and last_link has no "no_more" class #7

Closed FlashJunior closed 13 years ago

FlashJunior commented 13 years ago

If i am on "page 1", would it not make sense to have the "no_more" class on "first_link"? And if you are on the last, "no_more" class on "last_link".

FlashJunior commented 13 years ago

i build a very ugly workaround:

$(".list_holder").pajinate({
                items_per_page : 10,
                item_container_id : '.list2',
                nav_panel_id : '.list_nav',
                nav_label_first : '«',
                nav_label_last : '»',
                nav_label_prev : '‹',
                nav_label_next : '›'
            });

$(".list_nav a").bind("click", function(){                  
    if($(".previous_link").hasClass("no_more")){
        $(".first_link").addClass("no_more");
}else{
    $(".first_link").removeClass("no_more");
}

if($(".next_link").hasClass("no_more")){
    $(".last_link").addClass("no_more");
}else{
    $(".last_link").removeClass("no_more");
}
    })

$(".list_nav a.active_page").trigger("click");
wesnolte commented 13 years ago

Working on this right now. Will push the code in the next hour or two.

FlashJunior commented 13 years ago

thx.

wesnolte commented 13 years ago

"no_more" class is now added to first/last/prev/next in the appropriate situations.