-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
93a604c3276e8a2a8cdb26e6bacdfdf37dc37f02 Fix: Accessability improveme…
…nts with additional ARIA attributes for paging control https://datatables.net/forums/discussion/75174 Sync to source repo @93a604c3276e8a2a8cdb26e6bacdfdf37dc37f02
- Loading branch information
Showing
5 changed files
with
15 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/*! DataTables Bootstrap 4 integration | ||
* ©2011-2017 SpryMedia Ltd - datatables.net/license | ||
*/ | ||
import $ from"jquery";import DataTable from"datatables.net";$.extend(!0,DataTable.defaults,{dom:"<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",renderer:"bootstrap"}),$.extend(DataTable.ext.classes,{sWrapper:"dataTables_wrapper dt-bootstrap4",sFilterInput:"form-control form-control-sm",sLengthSelect:"custom-select custom-select-sm form-control form-control-sm",sProcessing:"dataTables_processing card",sPageButton:"paginate_button page-item"}),DataTable.ext.renderer.pageButton.bootstrap=function(i,a,d,e,n,c){function p(a,e){function t(a){a.preventDefault(),$(a.currentTarget).hasClass("disabled")||u.page()==a.data.action||u.page(a.data.action).draw("page")}for(var s,o,r=0,l=e.length;r<l;r++)if(o=e[r],Array.isArray(o))p(a,o);else{switch(m=b="",o){case"ellipsis":b="…",m="disabled";break;case"first":b=f.sFirst,m=o+(0<n?"":" disabled");break;case"previous":b=f.sPrevious,m=o+(0<n?"":" disabled");break;case"next":b=f.sNext,m=o+(n<c-1?"":" disabled");break;case"last":b=f.sLast,m=o+(n<c-1?"":" disabled");break;default:b=o+1,m=n===o?"active":""}b&&(s=$("<li>",{class:g.sPageButton+" "+m,id:0===d&&"string"==typeof o?i.sTableId+"_"+o:null}).append($("<a>",{href:"#","aria-controls":i.sTableId,"aria-label":x[o],"data-dt-idx":o,tabindex:i.iTabIndex,class:"page-link"}).html(b)).appendTo(a),i.oApi._fnBindAction(s,{action:o},t))}}var b,m,t,u=new DataTable.Api(i),g=i.oClasses,f=i.oLanguage.oPaginate,x=i.oLanguage.oAria.paginate||{};try{t=$(a).find(document.activeElement).data("dt-idx")}catch(a){}p($(a).empty().html('<ul class="pagination"/>').children("ul"),e),void 0!==t&&$(a).find("[data-dt-idx="+t+"]").trigger("focus")};export default DataTable; | ||
import $ from"jquery";import DataTable from"datatables.net";$.extend(!0,DataTable.defaults,{dom:"<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",renderer:"bootstrap"}),$.extend(DataTable.ext.classes,{sWrapper:"dataTables_wrapper dt-bootstrap4",sFilterInput:"form-control form-control-sm",sLengthSelect:"custom-select custom-select-sm form-control form-control-sm",sProcessing:"dataTables_processing card",sPageButton:"paginate_button page-item"}),DataTable.ext.renderer.pageButton.bootstrap=function(i,a,n,e,d,c){function p(a,e){function t(a){a.preventDefault(),$(a.currentTarget).hasClass("disabled")||m.page()==a.data.action||m.page(a.data.action).draw("page")}for(var s,l,r=0,o=e.length;r<o;r++)if(s=e[r],Array.isArray(s))p(a,s);else{switch(u=b="",s){case"ellipsis":b="…",u="disabled";break;case"first":b=f.sFirst,u=s+(0<d?"":" disabled");break;case"previous":b=f.sPrevious,u=s+(0<d?"":" disabled");break;case"next":b=f.sNext,u=s+(d<c-1?"":" disabled");break;case"last":b=f.sLast,u=s+(d<c-1?"":" disabled");break;default:b=s+1,u=d===s?"active":""}b&&(l=-1!==u.indexOf("disabled"),l=$("<li>",{class:g.sPageButton+" "+u,id:0===n&&"string"==typeof s?i.sTableId+"_"+s:null}).append($("<a>",{href:l?null:"#","aria-controls":i.sTableId,"aria-disabled":l?"true":null,"aria-label":x[s],"aria-role":"link","aria-current":"active"===u?"page":null,"data-dt-idx":s,tabindex:i.iTabIndex,class:"page-link"}).html(b)).appendTo(a),i.oApi._fnBindAction(l,{action:s},t))}}var b,u,t,m=new DataTable.Api(i),g=i.oClasses,f=i.oLanguage.oPaginate,x=i.oLanguage.oAria.paginate||{};try{t=$(a).find(document.activeElement).data("dt-idx")}catch(a){}p($(a).empty().html('<ul class="pagination"/>').children("ul"),e),void 0!==t&&$(a).find("[data-dt-idx="+t+"]").trigger("focus")};export default DataTable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters