victor-valencia / bootstrap-iconpicker

A simple icon picker
https://victor-valencia.github.com/bootstrap-iconpicker/
MIT License
380 stars 139 forks source link

Paging #37

Closed theflashjordan closed 7 years ago

theflashjordan commented 9 years ago

I can page to pages that don't exist. Paging buttons show disabled color & cursor, but on click they page to empty grid..

steveostudios commented 8 years ago

I'm having this problem too...

steveostudios commented 8 years ago

Fixed this. In bootstrap-iconpicker.js you need to fix the updateArrows function. You need to add the disabled property.

Iconpicker.prototype.updateArrows = function (page) {
        var op = this.options;
        var total_pages = this.totalPages();
        if (page === 1) {
            op.table.find('.btn-previous').addClass('disabled');
            op.table.find('.btn-previous').prop('disabled', true); // Add this
        }
        else {
            op.table.find('.btn-previous').removeClass('disabled');
            op.table.find('.btn-previous').prop('disabled', false); // And this
        }
        if (page === total_pages || total_pages === 0) {
            op.table.find('.btn-next').addClass('disabled');
            op.table.find('.btn-next').prop('disabled', true); // And this
        }
        else {
            op.table.find('.btn-next').removeClass('disabled');
            op.table.find('.btn-next').prop('disabled', false); // And this
        }
    };

Found it based on this issue: https://github.com/victor-valencia/bootstrap-iconpicker/issues/35

rhyudek1 commented 8 years ago

merge and new release? :disappointed:

plfort commented 8 years ago

Any news about this bug ?

cyberzilla commented 7 years ago

i found this bug, this can fixed it

Iconpicker.prototype.updateArrows = function (page) { var op = this.options; var total_pages = this.totalPages(); if (page === 1) { op.table.find('.btn-previous').addClass('disabled').val('0'); } else { op.table.find('.btn-previous').removeClass('disabled').val('-1'); } if (page === total_pages || total_pages === 0) { op.table.find('.btn-next').addClass('disabled').val('0'); } else { op.table.find('.btn-next').removeClass('disabled').val('1'); } };

victor-valencia commented 7 years ago

Hi @theflashjordan, @steveostudios, @rhyudek1, @plfort, and @cyberzilla.

This feature is available in:

v1.8.2.

Regards.

theflashjordan commented 7 years ago

Thank you!

Sent from my iPhone

On Jul 19, 2017, at 4:49 PM, Victor Valencia Rico notifications@github.com wrote:

Closed #37.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.