From 9c3c298a6478955d37038e3f8d0b94c7e93fa8c7 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Thu, 7 May 2015 22:25:53 -0400 Subject: [PATCH] Update bootstrap-iconpicker to allow for a reset button It doesn't work yet, though --- js/bootstrap-iconpicker.js | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/js/bootstrap-iconpicker.js b/js/bootstrap-iconpicker.js index b80a1311..e7728453 100644 --- a/js/bootstrap-iconpicker.js +++ b/js/bootstrap-iconpicker.js @@ -66,7 +66,8 @@ search: true, searchText: 'Search icon', selectedClass: 'btn-warning', - unselectedClass: 'btn-default' + unselectedClass: 'btn-default', + resetButton: true }; // ICONPICKER PRIVATE METHODS @@ -240,7 +241,7 @@ ' ', '' ]; - op.table.find('tfoot').empty().append(icons_count.join('')); + op.table.find('tfoot').append(icons_count.join('')); }; Iconpicker.prototype.updateLabels = function (page) { @@ -287,6 +288,7 @@ else { this.updatePagesCount(); this.updateSearch(); + this.addResetButton(); this.updateIconsCount(); } }; @@ -309,6 +311,24 @@ } op.table.find('thead').append(search); }; + + Iconpicker.prototype.addResetButton = function () { + var op = this.options; + var resetButton = [ + '', + '', + '', + '', + '' + ]; + resetButton = $(resetButton.join('')); + if (op.resetButton === true) { + resetButton.show(); + } else { + resetButton.hide(); + } + op.table.find('tfoot').empty().append(resetButton); + } // ICONPICKER PUBLIC METHODS // ==============================