Update bootstrap-iconpicker to allow for a reset button
It doesn't work yet, though
This commit is contained in:
parent
1ac6602246
commit
9c3c298a64
24
js/bootstrap-iconpicker.js
vendored
24
js/bootstrap-iconpicker.js
vendored
@ -66,7 +66,8 @@
|
|||||||
search: true,
|
search: true,
|
||||||
searchText: 'Search icon',
|
searchText: 'Search icon',
|
||||||
selectedClass: 'btn-warning',
|
selectedClass: 'btn-warning',
|
||||||
unselectedClass: 'btn-default'
|
unselectedClass: 'btn-default',
|
||||||
|
resetButton: true
|
||||||
};
|
};
|
||||||
|
|
||||||
// ICONPICKER PRIVATE METHODS
|
// ICONPICKER PRIVATE METHODS
|
||||||
@ -240,7 +241,7 @@
|
|||||||
' </td>',
|
' </td>',
|
||||||
'</tr>'
|
'</tr>'
|
||||||
];
|
];
|
||||||
op.table.find('tfoot').empty().append(icons_count.join(''));
|
op.table.find('tfoot').append(icons_count.join(''));
|
||||||
};
|
};
|
||||||
|
|
||||||
Iconpicker.prototype.updateLabels = function (page) {
|
Iconpicker.prototype.updateLabels = function (page) {
|
||||||
@ -287,6 +288,7 @@
|
|||||||
else {
|
else {
|
||||||
this.updatePagesCount();
|
this.updatePagesCount();
|
||||||
this.updateSearch();
|
this.updateSearch();
|
||||||
|
this.addResetButton();
|
||||||
this.updateIconsCount();
|
this.updateIconsCount();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -309,6 +311,24 @@
|
|||||||
}
|
}
|
||||||
op.table.find('thead').append(search);
|
op.table.find('thead').append(search);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Iconpicker.prototype.addResetButton = function () {
|
||||||
|
var op = this.options;
|
||||||
|
var resetButton = [
|
||||||
|
'<tr>',
|
||||||
|
'<td colspan="' + op.cols + '">',
|
||||||
|
'<button class="btn btn-danger" style="width: ' + op.cols * 39 + 'px;"><span class="glyphicon glyphicon-ban-circle"></span> Reset</button>',
|
||||||
|
'</td>',
|
||||||
|
'</tr>'
|
||||||
|
];
|
||||||
|
resetButton = $(resetButton.join(''));
|
||||||
|
if (op.resetButton === true) {
|
||||||
|
resetButton.show();
|
||||||
|
} else {
|
||||||
|
resetButton.hide();
|
||||||
|
}
|
||||||
|
op.table.find('tfoot').empty().append(resetButton);
|
||||||
|
}
|
||||||
|
|
||||||
// ICONPICKER PUBLIC METHODS
|
// ICONPICKER PUBLIC METHODS
|
||||||
// ==============================
|
// ==============================
|
||||||
|
Loading…
x
Reference in New Issue
Block a user