123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245 |
- (function( factory ){
- if ( typeof define === 'function' && define.amd ) {
-
- define( ['jquery', 'datatables.net'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
-
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net')(root, $).$;
- }
- return factory( $, root, root.document );
- };
- }
- else {
-
- factory( jQuery, window, document );
- }
- }(function( $, window, document, undefined ) {
- 'use strict';
- var DataTable = $.fn.dataTable;
- var namespaceCounter = 0;
- var KeyTable = function ( dt, opts ) {
-
- if ( ! DataTable.versionCheck || ! DataTable.versionCheck( '1.10.8' ) ) {
- throw 'KeyTable requires DataTables 1.10.8 or newer';
- }
-
- this.c = $.extend( true, {},
- DataTable.defaults.keyTable,
- KeyTable.defaults,
- opts
- );
-
- this.s = {
-
- dt: new DataTable.Api( dt ),
- enable: true,
-
- focusDraw: false,
-
- waitingForDraw: false,
-
- lastFocus: null,
-
- namespace: '.keyTable-'+(namespaceCounter++)
- };
-
- this.dom = {
- };
-
- var settings = this.s.dt.settings()[0];
- var exisiting = settings.keytable;
- if ( exisiting ) {
- return exisiting;
- }
- settings.keytable = this;
- this._constructor();
- };
- $.extend( KeyTable.prototype, {
-
-
- blur: function ()
- {
- this._blur();
- },
-
- enable: function ( state )
- {
- this.s.enable = state;
- },
-
- focus: function ( row, column )
- {
- this._focus( this.s.dt.cell( row, column ) );
- },
-
- focused: function ( cell )
- {
- var lastFocus = this.s.lastFocus;
- if ( ! lastFocus ) {
- return false;
- }
- var lastIdx = this.s.lastFocus.cell.index();
- return cell.row === lastIdx.row && cell.column === lastIdx.column;
- },
-
-
- _constructor: function ()
- {
- this._tabInput();
- var that = this;
- var dt = this.s.dt;
- var table = $( dt.table().node() );
- var namespace = this.s.namespace;
- var editorBlock = false;
-
- if ( table.css('position') === 'static' ) {
- table.css( 'position', 'relative' );
- }
-
- $( dt.table().body() ).on( 'click'+namespace, 'th, td', function (e) {
- if ( that.s.enable === false ) {
- return;
- }
- var cell = dt.cell( this );
- if ( ! cell.any() ) {
- return;
- }
- that._focus( cell, null, false, e );
- } );
-
- $( document ).on( 'keydown'+namespace, function (e) {
- if ( ! editorBlock ) {
- that._key( e );
- }
- } );
-
- if ( this.c.blurable ) {
- $( document ).on( 'mousedown'+namespace, function ( e ) {
-
- if ( $(e.target).parents( '.dataTables_filter' ).length ) {
- that._blur();
- }
-
- if ( $(e.target).parents().filter( dt.table().container() ).length ) {
- return;
- }
-
- if ( $(e.target).parents('div.DTE').length ) {
- return;
- }
-
- if ( $(e.target).parents('div.editor-datetime').length ) {
- return;
- }
-
- if ( $(e.target).parents().filter('.DTFC_Cloned').length ) {
- return;
- }
- that._blur();
- } );
- }
- if ( this.c.editor ) {
- var editor = this.c.editor;
-
- editor.on( 'open.keyTableMain', function (e, mode, action) {
- if ( mode !== 'inline' && that.s.enable ) {
- that.enable( false );
- editor.one( 'close'+namespace, function () {
- that.enable( true );
- } );
- }
- } );
- if ( this.c.editOnFocus ) {
- dt.on( 'key-focus'+namespace+' key-refocus'+namespace, function ( e, dt, cell, orig ) {
- that._editor( null, orig, true );
- } );
- }
-
-
- dt.on( 'key'+namespace, function ( e, dt, key, cell, orig ) {
- that._editor( key, orig, false );
- } );
-
-
- $( dt.table().body() ).on( 'dblclick'+namespace, 'th, td', function (e) {
- if ( that.s.enable === false ) {
- return;
- }
- var cell = dt.cell( this );
- if ( ! cell.any() ) {
- return;
- }
- that._editor( null, e, true );
- } );
-
- editor
- .on('preSubmit', function () {
- editorBlock = true;
- } )
- .on('preSubmitCancelled', function () {
- editorBlock = false;
- } )
- .on('submitComplete', function () {
- editorBlock = false;
- } );
- }
-
- if ( dt.settings()[0].oFeatures.bStateSave ) {
- dt.on( 'stateSaveParams'+namespace, function (e, s, d) {
- d.keyTable = that.s.lastFocus ?
- that.s.lastFocus.cell.index() :
- null;
- } );
- }
-
- dt.on( 'draw'+namespace, function (e) {
- if ( that.s.focusDraw ) {
- return;
- }
- var lastFocus = that.s.lastFocus;
- if ( lastFocus && lastFocus.node && $(lastFocus.node).closest('body') === document.body ) {
- var relative = that.s.lastFocus.relative;
- var info = dt.page.info();
- var row = relative.row + info.start;
- if ( info.recordsDisplay === 0 ) {
- return;
- }
-
- if ( row >= info.recordsDisplay ) {
- row = info.recordsDisplay - 1;
- }
- that._focus( row, relative.column, true, e );
- }
- } );
-
- if ( this.c.clipboard ) {
- this._clipboard();
- }
- dt.on( 'destroy'+namespace, function () {
- that._blur( true );
-
- dt.off( namespace );
- $( dt.table().body() )
- .off( 'click'+namespace, 'th, td' )
- .off( 'dblclick'+namespace, 'th, td' );
- $( document )
- .off( 'mousedown'+namespace )
- .off( 'keydown'+namespace )
- .off( 'copy'+namespace )
- .off( 'paste'+namespace );
- } );
-
- var state = dt.state.loaded();
- if ( state && state.keyTable ) {
-
- dt.one( 'init', function () {
- var cell = dt.cell( state.keyTable );
-
- if ( cell.any() ) {
- cell.focus();
- }
- } );
- }
- else if ( this.c.focus ) {
- dt.cell( this.c.focus ).focus();
- }
- },
-
-
- _blur: function (noEvents)
- {
- if ( ! this.s.enable || ! this.s.lastFocus ) {
- return;
- }
- var cell = this.s.lastFocus.cell;
- $( cell.node() ).removeClass( this.c.className );
- this.s.lastFocus = null;
- if ( ! noEvents ) {
- this._updateFixedColumns(cell.index().column);
- this._emitEvent( 'key-blur', [ this.s.dt, cell ] );
- }
- },
-
- _clipboard: function () {
- var dt = this.s.dt;
- var that = this;
- var namespace = this.s.namespace;
-
- if ( ! window.getSelection ) {
- return;
- }
- $(document).on( 'copy'+namespace, function (ejq) {
- var e = ejq.originalEvent;
- var selection = window.getSelection().toString();
- var focused = that.s.lastFocus;
-
-
- if ( ! selection && focused ) {
- e.clipboardData.setData(
- 'text/plain',
- focused.cell.render( that.c.clipboardOrthogonal )
- );
- e.preventDefault();
- }
- } );
- $(document).on( 'paste'+namespace, function (ejq) {
- var e = ejq.originalEvent;
- var focused = that.s.lastFocus;
- var activeEl = document.activeElement;
- var editor = that.c.editor;
- var pastedText;
- if ( focused && (! activeEl || activeEl.nodeName.toLowerCase() === 'body') ) {
- e.preventDefault();
- if ( window.clipboardData && window.clipboardData.getData ) {
-
- pastedText = window.clipboardData.getData('Text');
- }
- else if ( e.clipboardData && e.clipboardData.getData ) {
-
- pastedText = e.clipboardData.getData('text/plain');
- }
- if ( editor ) {
-
-
- editor
- .inline( focused.cell.index() )
- .set( editor.displayed()[0], pastedText )
- .submit();
- }
- else {
-
- focused.cell.data( pastedText );
- dt.draw(false);
- }
- }
- } );
- },
-
- _columns: function ()
- {
- var dt = this.s.dt;
- var user = dt.columns( this.c.columns ).indexes();
- var out = [];
- dt.columns( ':visible' ).every( function (i) {
- if ( user.indexOf( i ) !== -1 ) {
- out.push( i );
- }
- } );
- return out;
- },
-
- _editor: function ( key, orig, hardEdit )
- {
- var that = this;
- var dt = this.s.dt;
- var editor = this.c.editor;
- var editCell = this.s.lastFocus.cell;
- var namespace = this.s.namespace;
-
- if ( $('div.DTE', editCell.node()).length ) {
- return;
- }
-
- if ( key !== null && (
- (key >= 0x00 && key <= 0x09) ||
- key === 0x0b ||
- key === 0x0c ||
- (key >= 0x0e && key <= 0x1f) ||
- (key >= 0x70 && key <= 0x7b) ||
- (key >= 0x7f && key <= 0x9f)
- ) ) {
- return;
- }
- orig.stopPropagation();
-
-
- if ( key === 13 ) {
- orig.preventDefault();
- }
- var editInline = function () {
- editor
- .one( 'open'+namespace, function () {
-
- editor.off( 'cancelOpen'+namespace );
-
- if ( ! hardEdit ) {
- $('div.DTE_Field_InputControl input, div.DTE_Field_InputControl textarea').select();
- }
-
- dt.keys.enable( hardEdit ? 'tab-only' : 'navigation-only' );
-
- dt.on( 'key-blur.editor', function (e, dt, cell) {
- if ( editor.displayed() && cell.node() === editCell.node() ) {
- editor.submit();
- }
- } );
-
- if ( hardEdit ) {
- $( dt.table().container() ).addClass('dtk-focus-alt');
- }
-
- editor.on( 'preSubmitCancelled'+namespace, function () {
- setTimeout( function () {
- that._focus( editCell, null, false );
- }, 50 );
- } );
- editor.on( 'submitUnsuccessful'+namespace, function () {
- that._focus( editCell, null, false );
- } );
-
- editor.one( 'close', function () {
- dt.keys.enable( true );
- dt.off( 'key-blur.editor' );
- editor.off( namespace );
- $( dt.table().container() ).removeClass('dtk-focus-alt');
- } );
- } )
- .one( 'cancelOpen'+namespace, function () {
-
-
- editor.off( namespace );
- } )
- .inline( editCell.index() );
- };
-
-
-
- if ( key === 13 ) {
- hardEdit = true;
- $(document).one( 'keyup', function () {
- editInline();
- } );
- }
- else {
- editInline();
- }
- },
-
- _emitEvent: function ( name, args )
- {
- this.s.dt.iterator( 'table', function ( ctx, i ) {
- $(ctx.nTable).triggerHandler( name, args );
- } );
- },
-
- _focus: function ( row, column, shift, originalEvent )
- {
- var that = this;
- var dt = this.s.dt;
- var pageInfo = dt.page.info();
- var lastFocus = this.s.lastFocus;
- if ( ! originalEvent) {
- originalEvent = null;
- }
- if ( ! this.s.enable ) {
- return;
- }
- if ( typeof row !== 'number' ) {
-
- if ( ! row.any() ) {
- return;
- }
-
- var index = row.index();
- column = index.column;
- row = dt
- .rows( { filter: 'applied', order: 'applied' } )
- .indexes()
- .indexOf( index.row );
-
-
- if ( row < 0 ) {
- return;
- }
-
-
-
- if ( pageInfo.serverSide ) {
- row += pageInfo.start;
- }
- }
-
-
- if ( pageInfo.length !== -1 && (row < pageInfo.start || row >= pageInfo.start+pageInfo.length) ) {
- this.s.focusDraw = true;
- this.s.waitingForDraw = true;
- dt
- .one( 'draw', function () {
- that.s.focusDraw = false;
- that.s.waitingForDraw = false;
- that._focus( row, column, undefined, originalEvent );
- } )
- .page( Math.floor( row / pageInfo.length ) )
- .draw( false );
- return;
- }
-
- if ( $.inArray( column, this._columns() ) === -1 ) {
- return;
- }
-
-
- if ( pageInfo.serverSide ) {
- row -= pageInfo.start;
- }
-
-
- var cells = dt.cells( null, column, {search: 'applied', order: 'applied'} ).flatten();
- var cell = dt.cell( cells[ row ] );
- if ( lastFocus ) {
-
- if ( lastFocus.node === cell.node() ) {
- this._emitEvent( 'key-refocus', [ this.s.dt, cell, originalEvent || null ] );
- return;
- }
-
- this._blur();
- }
-
- this._removeOtherFocus();
- var node = $( cell.node() );
- node.addClass( this.c.className );
- this._updateFixedColumns(column);
-
- if ( shift === undefined || shift === true ) {
- this._scroll( $(window), $(document.body), node, 'offset' );
- var bodyParent = dt.table().body().parentNode;
- if ( bodyParent !== dt.table().header().parentNode ) {
- var parent = $(bodyParent.parentNode);
- this._scroll( parent, parent, node, 'position' );
- }
- }
-
- this.s.lastFocus = {
- cell: cell,
- node: cell.node(),
- relative: {
- row: dt.rows( { page: 'current' } ).indexes().indexOf( cell.index().row ),
- column: cell.index().column
- }
- };
- this._emitEvent( 'key-focus', [ this.s.dt, cell, originalEvent || null ] );
- dt.state.save();
- },
-
- _key: function ( e )
- {
-
-
- if ( this.s.waitingForDraw ) {
- e.preventDefault();
- return;
- }
- var enable = this.s.enable;
- var navEnable = enable === true || enable === 'navigation-only';
- if ( ! enable ) {
- return;
- }
- if ( (e.keyCode === 0 || e.ctrlKey || e.metaKey || e.altKey) && !(e.ctrlKey && e.altKey) ) {
- return;
- }
-
- var lastFocus = this.s.lastFocus;
- if ( ! lastFocus ) {
- return;
- }
-
- if ( ! this.s.dt.cell(lastFocus.node).any() ) {
- this.s.lastFocus = null;
- return;
- }
- var that = this;
- var dt = this.s.dt;
- var scrolling = this.s.dt.settings()[0].oScroll.sY ? true : false;
-
- if ( this.c.keys && $.inArray( e.keyCode, this.c.keys ) === -1 ) {
- return;
- }
- switch( e.keyCode ) {
- case 9:
-
- this._shift( e, e.shiftKey ? 'left' : 'right', true );
- break;
- case 27:
- if ( this.s.blurable && enable === true ) {
- this._blur();
- }
- break;
- case 33:
- case 34:
- if ( navEnable && !scrolling ) {
- e.preventDefault();
- dt
- .page( e.keyCode === 33 ? 'previous' : 'next' )
- .draw( false );
- }
- break;
- case 35:
- case 36:
- if ( navEnable ) {
- e.preventDefault();
- var indexes = dt.cells( {page: 'current'} ).indexes();
- var colIndexes = this._columns();
- this._focus( dt.cell(
- indexes[ e.keyCode === 35 ? indexes.length-1 : colIndexes[0] ]
- ), null, true, e );
- }
- break;
- case 37:
- if ( navEnable ) {
- this._shift( e, 'left' );
- }
- break;
- case 38:
- if ( navEnable ) {
- this._shift( e, 'up' );
- }
- break;
- case 39:
- if ( navEnable ) {
- this._shift( e, 'right' );
- }
- break;
- case 40:
- if ( navEnable ) {
- this._shift( e, 'down' );
- }
- break;
- case 113:
- if ( this.c.editor ) {
- this._editor(null, e, true);
- break;
- }
-
- default:
-
- if ( enable === true ) {
- this._emitEvent( 'key', [ dt, e.keyCode, this.s.lastFocus.cell, e ] );
- }
- break;
- }
- },
-
- _removeOtherFocus: function ()
- {
- var thisTable = this.s.dt.table().node();
- $.fn.dataTable.tables({api:true}).iterator('table', function (settings) {
- if (this.table().node() !== thisTable) {
- this.cell.blur();
- }
- });
- },
-
- _scroll: function ( container, scroller, cell, posOff )
- {
- var offset = cell[posOff]();
- var height = cell.outerHeight();
- var width = cell.outerWidth();
- var scrollTop = scroller.scrollTop();
- var scrollLeft = scroller.scrollLeft();
- var containerHeight = container.height();
- var containerWidth = container.width();
-
-
- if ( posOff === 'position' ) {
- offset.top += parseInt( cell.closest('table').css('top'), 10 );
- }
-
- if ( offset.top < scrollTop ) {
- scroller.scrollTop( offset.top );
- }
-
- if ( offset.left < scrollLeft ) {
- scroller.scrollLeft( offset.left );
- }
-
- if ( offset.top + height > scrollTop + containerHeight && height < containerHeight ) {
- scroller.scrollTop( offset.top + height - containerHeight );
- }
-
- if ( offset.left + width > scrollLeft + containerWidth && width < containerWidth ) {
- scroller.scrollLeft( offset.left + width - containerWidth );
- }
- },
-
- _shift: function ( e, direction, keyBlurable )
- {
- var that = this;
- var dt = this.s.dt;
- var pageInfo = dt.page.info();
- var rows = pageInfo.recordsDisplay;
- var currentCell = this.s.lastFocus.cell;
- var columns = this._columns();
- if ( ! currentCell ) {
- return;
- }
- var currRow = dt
- .rows( { filter: 'applied', order: 'applied' } )
- .indexes()
- .indexOf( currentCell.index().row );
-
-
-
- if ( pageInfo.serverSide ) {
- currRow += pageInfo.start;
- }
- var currCol = dt
- .columns( columns )
- .indexes()
- .indexOf( currentCell.index().column );
- var
- row = currRow,
- column = columns[ currCol ];
- if ( direction === 'right' ) {
- if ( currCol >= columns.length - 1 ) {
- row++;
- column = columns[0];
- }
- else {
- column = columns[ currCol+1 ];
- }
- }
- else if ( direction === 'left' ) {
- if ( currCol === 0 ) {
- row--;
- column = columns[ columns.length - 1 ];
- }
- else {
- column = columns[ currCol-1 ];
- }
- }
- else if ( direction === 'up' ) {
- row--;
- }
- else if ( direction === 'down' ) {
- row++;
- }
- if ( row >= 0 && row < rows && $.inArray( column, columns ) !== -1 ) {
- if (e) {
- e.preventDefault();
- }
- this._focus( row, column, true, e );
- }
- else if ( ! keyBlurable || ! this.c.blurable ) {
-
-
- if (e) {
- e.preventDefault();
- }
- }
- else {
- this._blur();
- }
- },
-
- _tabInput: function ()
- {
- var that = this;
- var dt = this.s.dt;
- var tabIndex = this.c.tabIndex !== null ?
- this.c.tabIndex :
- dt.settings()[0].iTabIndex;
- if ( tabIndex == -1 ) {
- return;
- }
- var div = $('<div><input type="text" tabindex="'+tabIndex+'"/></div>')
- .css( {
- position: 'absolute',
- height: 1,
- width: 0,
- overflow: 'hidden'
- } )
- .insertBefore( dt.table().node() );
- div.children().on( 'focus', function (e) {
- var cell = dt.cell(':eq(0)', that._columns(), {page: 'current'});
- if ( cell.any() ) {
- that._focus( cell, null, true, e );
- }
- } );
- },
-
- _updateFixedColumns: function( column )
- {
- var dt = this.s.dt;
- var settings = dt.settings()[0];
- if ( settings._oFixedColumns ) {
- var leftCols = settings._oFixedColumns.s.iLeftColumns;
- var rightCols = settings.aoColumns.length - settings._oFixedColumns.s.iRightColumns;
- if (column < leftCols || column >= rightCols) {
- dt.fixedColumns().update();
- }
- }
- }
- } );
- KeyTable.defaults = {
-
- blurable: true,
-
- className: 'focus',
-
- clipboard: true,
-
- clipboardOrthogonal: 'display',
-
- columns: '',
-
- editor: null,
-
- editOnFocus: false,
-
- focus: null,
-
- keys: null,
-
- tabIndex: null
- };
- KeyTable.version = "2.5.1";
- $.fn.dataTable.KeyTable = KeyTable;
- $.fn.DataTable.KeyTable = KeyTable;
- DataTable.Api.register( 'cell.blur()', function () {
- return this.iterator( 'table', function (ctx) {
- if ( ctx.keytable ) {
- ctx.keytable.blur();
- }
- } );
- } );
- DataTable.Api.register( 'cell().focus()', function () {
- return this.iterator( 'cell', function (ctx, row, column) {
- if ( ctx.keytable ) {
- ctx.keytable.focus( row, column );
- }
- } );
- } );
- DataTable.Api.register( 'keys.disable()', function () {
- return this.iterator( 'table', function (ctx) {
- if ( ctx.keytable ) {
- ctx.keytable.enable( false );
- }
- } );
- } );
- DataTable.Api.register( 'keys.enable()', function ( opts ) {
- return this.iterator( 'table', function (ctx) {
- if ( ctx.keytable ) {
- ctx.keytable.enable( opts === undefined ? true : opts );
- }
- } );
- } );
- DataTable.Api.register( 'keys.move()', function ( dir ) {
- return this.iterator( 'table', function (ctx) {
- if ( ctx.keytable ) {
- ctx.keytable._shift( null, dir, false );
- }
- } );
- } );
- DataTable.ext.selector.cell.push( function ( settings, opts, cells ) {
- var focused = opts.focused;
- var kt = settings.keytable;
- var out = [];
- if ( ! kt || focused === undefined ) {
- return cells;
- }
- for ( var i=0, ien=cells.length ; i<ien ; i++ ) {
- if ( (focused === true && kt.focused( cells[i] ) ) ||
- (focused === false && ! kt.focused( cells[i] ) )
- ) {
- out.push( cells[i] );
- }
- }
- return out;
- } );
- $(document).on( 'preInit.dt.dtk', function (e, settings, json) {
- if ( e.namespace !== 'dt' ) {
- return;
- }
- var init = settings.oInit.keys;
- var defaults = DataTable.defaults.keys;
- if ( init || defaults ) {
- var opts = $.extend( {}, defaults, init );
- if ( init !== false ) {
- new KeyTable( settings, opts );
- }
- }
- } );
- return KeyTable;
- }));
|