From bb253155e65f6ee5753f55b48d1c28fcfe0c28f7 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Fri, 2 Dec 2016 17:59:44 +0000 Subject: [PATCH] Fix: If there is no active element when paging, don't attempt to refocus Merge pull request #76 from MuellerMatthew/patch-1 --- .datatables-commit-sync | 2 +- media/js/dataTables.bootstrap.js | 4 ++-- media/js/dataTables.bootstrap.min.js | 8 ++++---- media/js/dataTables.bootstrap4.js | 4 ++-- media/js/dataTables.bootstrap4.min.js | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.datatables-commit-sync b/.datatables-commit-sync index 4489b42d..7a1d3735 100644 --- a/.datatables-commit-sync +++ b/.datatables-commit-sync @@ -1 +1 @@ -6049a1ef47109ef5d4a940b2e4d567d032d91459 +080a909f808829d6cf8e05e3d3eccff2e6080e53 diff --git a/media/js/dataTables.bootstrap.js b/media/js/dataTables.bootstrap.js index 417aec3d..f69acdc6 100644 --- a/media/js/dataTables.bootstrap.js +++ b/media/js/dataTables.bootstrap.js @@ -172,11 +172,11 @@ DataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, bu buttons ); - if ( activeEl ) { + if ( activeEl !== undefined ) { $(host).find( '[data-dt-idx='+activeEl+']' ).focus(); } }; return DataTable; -})); \ No newline at end of file +})); diff --git a/media/js/dataTables.bootstrap.min.js b/media/js/dataTables.bootstrap.min.js index 2d824c8f..98661c6c 100644 --- a/media/js/dataTables.bootstrap.min.js +++ b/media/js/dataTables.bootstrap.min.js @@ -2,7 +2,7 @@ DataTables Bootstrap 3 integration ©2011-2015 SpryMedia Ltd - datatables.net/license */ -(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,d){a||(a=window);if(!d||!d.fn.dataTable)d=require("datatables.net")(a,d).$;return b(d,a,a.document)}:b(jQuery,window,document)})(function(b,a,d){var f=b.fn.dataTable;b.extend(!0,f.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(f.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"});f.ext.renderer.pageButton.bootstrap=function(a,h,r,m,j,n){var o=new f.Api(a),s=a.oClasses,k=a.oLanguage.oPaginate,t=a.oLanguage.oAria.paginate||{},e,g,p=0,q=function(d,f){var l,h,i,c,m=function(a){a.preventDefault();!b(a.currentTarget).hasClass("disabled")&&o.page()!=a.data.action&&o.page(a.data.action).draw("page")}; -l=0;for(h=f.length;l",{"class":s.sPageButton+" "+g,id:0===r&&"string"===typeof c?a.sTableId+"_"+c:null}).append(b("",{href:"#", -"aria-controls":a.sTableId,"aria-label":t[c],"data-dt-idx":p,tabindex:a.iTabIndex}).html(e)).appendTo(d),a.oApi._fnBindAction(i,{action:c},m),p++)}},i;try{i=b(h).find(d.activeElement).data("dt-idx")}catch(u){}q(b(h).empty().html('