mirror of
https://github.com/DataTables/DataTables.git
synced 2024-12-02 14:24:11 +01:00
d481e0d441
- Cannot pass in a `dt` instance - will always use the one from the jQuery instance given - Don't check for reinitialisation or for jQuery when working in the browser - will throw an error if in browser and no jQuery, which is correct, DataTables needs jQuery
10 lines
2.1 KiB
JavaScript
10 lines
2.1 KiB
JavaScript
/*!
|
|
DataTables Bootstrap 3 integration
|
|
©2011-2015 SpryMedia Ltd - datatables.net/license
|
|
*/
|
|
(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables"],b):"object"===typeof exports?module.exports=function(a){a||(a=require("jquery"));a.fn.dataTable||require("datatables")(a);b(a)}:b(jQuery)})(function(b){var a=b.fn.dataTable;b.extend(!0,a.defaults,{dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-5'i><'col-sm-7'p>>",renderer:"bootstrap"});b.extend(a.ext.classes,{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",
|
|
sLengthSelect:"form-control input-sm",sProcessing:"dataTables_processing panel panel-default"});a.ext.renderer.pageButton.bootstrap=function(f,g,r,l,i,m){var n=new a.Api(f),s=f.oClasses,j=f.oLanguage.oPaginate,d,e,o=0,q=function(a,g){var k,h,p,c,l=function(a){a.preventDefault();!b(a.currentTarget).hasClass("disabled")&&n.page()!=a.data.action&&n.page(a.data.action).draw("page")};k=0;for(h=g.length;k<h;k++)if(c=g[k],b.isArray(c))q(a,c);else{e=d="";switch(c){case "ellipsis":d="…";e="disabled";
|
|
break;case "first":d=j.sFirst;e=c+(0<i?"":" disabled");break;case "previous":d=j.sPrevious;e=c+(0<i?"":" disabled");break;case "next":d=j.sNext;e=c+(i<m-1?"":" disabled");break;case "last":d=j.sLast;e=c+(i<m-1?"":" disabled");break;default:d=c+1,e=i===c?"active":""}d&&(p=b("<li>",{"class":s.sPageButton+" "+e,id:0===r&&"string"===typeof c?f.sTableId+"_"+c:null}).append(b("<a>",{href:"#","aria-controls":f.sTableId,"data-dt-idx":o,tabindex:f.iTabIndex}).html(d)).appendTo(a),f.oApi._fnBindAction(p,{action:c},
|
|
l),o++)}},h;try{h=b(g).find(document.activeElement).data("dt-idx")}catch(t){}q(b(g).empty().html('<ul class="pagination"/>').children("ul"),l);h&&b(g).find("[data-dt-idx="+h+"]").focus()};a.TableTools&&(b.extend(!0,a.TableTools.classes,{container:"DTTT btn-group",buttons:{normal:"btn btn-default",disabled:"disabled"},collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:"disabled"}},print:{info:"DTTT_print_info"},select:{row:"active"}}),b.extend(!0,a.TableTools.DEFAULTS.oTags,
|
|
{collection:{container:"ul",button:"li",liner:"a"}}));return a});
|