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

8 lines
1.5 KiB
JavaScript

/*!
DataTables Foundation integration
©2011-2014 SpryMedia Ltd - datatables.net/license
*/
(function(){var d=function(e,f){e.extend(f.ext.classes,{sWrapper:"dataTables_wrapper dt-foundation",sProcessing:"dataTables_processing panel"});e.extend(!0,f.defaults,{dom:"<'row'<'small-6 columns'l><'small-6 columns'f>r>t<'row'<'small-6 columns'i><'small-6 columns'p>>",renderer:"foundation"});f.ext.renderer.pageButton.foundation=function(g,d,q,k,h,l){var m=new f.Api(g),r=g.oClasses,i=g.oLanguage.oPaginate,b,c,p=function(d,f){var j,n,o,a,k=function(a){a.preventDefault();!e(a.currentTarget).hasClass("unavailable")&&
m.page()!=a.data.action&&m.page(a.data.action).draw("page")};j=0;for(n=f.length;j<n;j++)if(a=f[j],e.isArray(a))p(d,a);else{c=b="";switch(a){case "ellipsis":b="&hellip;";c="unavailable";break;case "first":b=i.sFirst;c=a+(0<h?"":" unavailable");break;case "previous":b=i.sPrevious;c=a+(0<h?"":" unavailable");break;case "next":b=i.sNext;c=a+(h<l-1?"":" unavailable");break;case "last":b=i.sLast;c=a+(h<l-1?"":" unavailable");break;default:b=a+1,c=h===a?"current":""}b&&(o=e("<li>",{"class":r.sPageButton+
" "+c,"aria-controls":g.sTableId,tabindex:g.iTabIndex,id:0===q&&"string"===typeof a?g.sTableId+"_"+a:null}).append(e("<a>",{href:"#"}).html(b)).appendTo(d),g.oApi._fnBindAction(o,{action:a},k))}};p(e(d).empty().html('<ul class="pagination"/>').children("ul"),k)}};"function"===typeof define&&define.amd?define(["jquery","datatables"],d):"object"===typeof exports?d(require("jquery"),require("datatables")):jQuery&&d(jQuery,jQuery.fn.dataTable)})(window,document);