1
0
mirror of https://github.com/DataTables/DataTables.git synced 2024-12-04 16:24:11 +01:00
DataTables/media/js/dataTables.foundation.min.js

9 lines
2.1 KiB
JavaScript
Raw Normal View History

2015-08-12 21:17:46 +02:00
/*!
DataTables Foundation integration
©2011-2015 SpryMedia Ltd - datatables.net/license
2015-08-12 21:17:46 +02:00
*/
(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,d){a||(a=window);d&&d.fn.dataTable||(d=require("datatables.net")(a,d).$);return c(d,a,a.document)}:c(jQuery,window,document)})(function(c,a,d,z){var e=c.fn.dataTable;a=c('<meta class="foundation-mq"/>').appendTo("head");e.ext.foundationVersion=a.css("font-family").match(/small|medium|large/)?6:5;a.remove();c.extend(e.ext.classes,
{sWrapper:"dataTables_wrapper dt-foundation",sProcessing:"dataTables_processing panel callout"});c.extend(!0,e.defaults,{dom:"<'row'<'small-6 columns'l><'small-6 columns'f>r>t<'row'<'small-6 columns'i><'small-6 columns'p>>",renderer:"foundation"});e.ext.renderer.pageButton.foundation=function(a,d,v,p,f,l){var q=new e.Api(a),w=a.oClasses,m=a.oLanguage.oPaginate,x=a.oLanguage.oAria.paginate||{},g,k,h,y=5===e.ext.foundationVersion,u=function(d,e){var n,r,t,b,p=function(a){a.preventDefault();c(a.currentTarget).hasClass("unavailable")||
q.page()==a.data.action||q.page(a.data.action).draw("page")};n=0;for(r=e.length;n<r;n++)if(b=e[n],c.isArray(b))u(d,b);else{k=g="";h=null;switch(b){case "ellipsis":g="&#x2026;";k="unavailable disabled";h=null;break;case "first":g=m.sFirst;k=b+(0<f?"":" unavailable disabled");h=0<f?"a":null;break;case "previous":g=m.sPrevious;k=b+(0<f?"":" unavailable disabled");h=0<f?"a":null;break;case "next":g=m.sNext;k=b+(f<l-1?"":" unavailable disabled");h=f<l-1?"a":null;break;case "last":g=m.sLast;k=b+(f<l-1?
"":" unavailable disabled");h=f<l-1?"a":null;break;default:g=b+1,k=f===b?"current":"",h=f===b?null:"a"}y&&(h="a");g&&(t=c("<li>",{"class":w.sPageButton+" "+k,"aria-controls":a.sTableId,"aria-label":x[b],tabindex:a.iTabIndex,id:0===v&&"string"===typeof b?a.sTableId+"_"+b:null}).append(h?c("<"+h+"/>",{href:"#"}).html(g):g).appendTo(d),a.oApi._fnBindAction(t,{action:b},p))}};u(c(d).empty().html('<ul class="pagination"/>').children("ul"),p)};return e});