vendor/assets/javascripts/extensions/bootstrap-table-export.js in bootstrap-table-rails-1.10.1 vs vendor/assets/javascripts/extensions/bootstrap-table-export.js in bootstrap-table-rails-1.11.0
- old
+ new
@@ -30,10 +30,17 @@
$.extend($.fn.bootstrapTable.defaults.icons, {
export: 'glyphicon-export icon-share'
});
+ $.extend($.fn.bootstrapTable.locales, {
+ formatExport: function () {
+ return 'Export data';
+ }
+ });
+ $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
+
var BootstrapTable = $.fn.bootstrapTable.Constructor,
_initToolbar = BootstrapTable.prototype.initToolbar;
BootstrapTable.prototype.initToolbar = function () {
this.showToolbar = this.options.showExport;
@@ -46,13 +53,15 @@
$export = $btnGroup.find('div.export');
if (!$export.length) {
$export = $([
'<div class="export btn-group">',
- '<button class="btn btn-default' +
+ '<button class="btn' +
+ sprintf(' btn-%s', this.options.buttonsClass) +
sprintf(' btn-%s', this.options.iconSize) +
' dropdown-toggle" ' +
+ 'title="' + this.options.formatExport() + '" ' +
'data-toggle="dropdown" type="button">',
sprintf('<i class="%s %s"></i> ', this.options.iconsPrefix, this.options.icons.export),
'<span class="caret"></span>',
'</button>',
'<ul class="dropdown-menu" role="menu">',
@@ -88,10 +97,10 @@
escape: false
}));
};
if (that.options.exportDataType === 'all' && that.options.pagination) {
- that.$el.one('load-success.bs.table page-change.bs.table', function () {
+ that.$el.one(that.options.sidePagination === 'server' ? 'post-body.bs.table' : 'page-change.bs.table', function () {
doExport();
that.togglePagination();
});
that.togglePagination();
} else if (that.options.exportDataType === 'selected') {