mirror of
https://github.com/DataTables/DataTables.git
synced 2024-12-04 16:24:11 +01:00
f3fc3cd64e
- Thanks sameeralikhan - thread 32212
9 lines
1.9 KiB
JavaScript
9 lines
1.9 KiB
JavaScript
/*!
|
|
DataTables Foundation integration
|
|
©2011-2015 SpryMedia Ltd - datatables.net/license
|
|
*/
|
|
(function(d){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return d(a,window,document)}):"object"===typeof exports?module.exports=function(a,c){a||(a=window);if(!c||!c.fn.dataTable)c=require("datatables.net")(a,c).$;return d(c,a,a.document)}:d(jQuery,window,document)})(function(d){var a=d.fn.dataTable;d.extend(a.ext.classes,{sWrapper:"dataTables_wrapper dt-foundation",sProcessing:"dataTables_processing panel"});d.extend(!0,a.defaults,{dom:"<'row'<'small-6 columns'l><'small-6 columns'f>r>t<'row'<'small-6 columns'i><'small-6 columns'p>>",
|
|
renderer:"foundation"});a.ext.renderer.pageButton.foundation=function(c,l,r,s,e,i){var m=new a.Api(c),t=c.oClasses,j=c.oLanguage.oPaginate,u=c.oLanguage.oAria.paginate||{},f,h,g,q=function(a,n){var k,o,p,b,l=function(a){a.preventDefault();!d(a.currentTarget).hasClass("unavailable")&&m.page()!=a.data.action&&m.page(a.data.action).draw("page")};k=0;for(o=n.length;k<o;k++)if(b=n[k],d.isArray(b))q(a,b);else{h=f="";g=null;switch(b){case "ellipsis":f="…";h="unavailable disabled";g=null;break;case "first":f=
|
|
j.sFirst;h=b+(0<e?"":" unavailable disabled");g=0<e?"a":null;break;case "previous":f=j.sPrevious;h=b+(0<e?"":" unavailable disabled");g=0<e?"a":null;break;case "next":f=j.sNext;h=b+(e<i-1?"":" unavailable disabled");g=e<i-1?"a":null;break;case "last":f=j.sLast;h=b+(e<i-1?"":" unavailable disabled");g=e<i-1?"a":null;break;default:f=b+1,h=e===b?"current":"",g=e===b?null:"a"}f&&(p=d("<li>",{"class":t.sPageButton+" "+h,"aria-controls":c.sTableId,"aria-label":u[b],tabindex:c.iTabIndex,id:0===r&&"string"===
|
|
typeof b?c.sTableId+"_"+b:null}).append(g?d("<"+g+"/>",{href:"#"}).html(f):f).appendTo(a),c.oApi._fnBindAction(p,{action:b},l))}};q(d(l).empty().html('<ul class="pagination"/>').children("ul"),s)};return a});
|