vendor/assets/javascripts/extensions/bootstrap-table-export.js in bootstrap-table-rails-1.9.1 vs vendor/assets/javascripts/extensions/bootstrap-table-export.js in bootstrap-table-rails-1.10.0

- old
+ new

@@ -3,10 +3,11 @@ * extensions: https://github.com/kayalshri/tableExport.jquery.plugin */ (function ($) { 'use strict'; + var sprintf = $.fn.bootstrapTable.utils.sprintf; var TYPE_NAME = { json: 'JSON', xml: 'XML', png: 'PNG', @@ -25,10 +26,14 @@ // 'json', 'xml', 'png', 'csv', 'txt', 'sql', 'doc', 'excel', 'powerpoint', 'pdf' exportTypes: ['json', 'xml', 'csv', 'txt', 'sql', 'excel'], exportOptions: {} }); + $.extend($.fn.bootstrapTable.defaults.icons, { + export: 'glyphicon-export icon-share' + }); + var BootstrapTable = $.fn.bootstrapTable.Constructor, _initToolbar = BootstrapTable.prototype.initToolbar; BootstrapTable.prototype.initToolbar = function () { this.showToolbar = this.options.showExport; @@ -41,12 +46,14 @@ $export = $btnGroup.find('div.export'); if (!$export.length) { $export = $([ '<div class="export btn-group">', - '<button class="btn btn-default dropdown-toggle" ' + + '<button class="btn btn-default' + + sprintf(' btn-%s', this.options.iconSize) + + ' dropdown-toggle" ' + 'data-toggle="dropdown" type="button">', - '<i class="glyphicon glyphicon-export icon-share"></i> ', + sprintf('<i class="%s %s"></i> ', this.options.iconsPrefix, this.options.icons.export), '<span class="caret"></span>', '</button>', '<ul class="dropdown-menu" role="menu">', '</ul>', '</div>'].join('')).appendTo($btnGroup);