datatables.net-keytable
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -1,2 +0,2 @@ | ||
/*! KeyTable 2.2.0 | ||
/*! KeyTable 2.2.1 | ||
* ©2009-2016 SpryMedia Ltd - datatables.net/license | ||
@@ -8,3 +8,3 @@ */ | ||
* @description Spreadsheet like keyboard navigation for DataTables | ||
* @version 2.2.0 | ||
* @version 2.2.1 | ||
* @file dataTables.keyTable.js | ||
@@ -215,2 +215,7 @@ * @author SpryMedia Ltd (www.sprymedia.co.uk) | ||
// Or an Editor date input | ||
if ( $(e.target).parents('div.editor-datetime').length ) { | ||
return; | ||
} | ||
//If the click was inside the fixed columns container, don't blur | ||
@@ -248,3 +253,3 @@ if ( $(e.target).parents().filter('.DTFC_Cloned').length ) { | ||
if ( lastFocus ) { | ||
if ( lastFocus && lastFocus.node && $(lastFocus.node).closest('body') === document.body ) { | ||
var relative = that.s.lastFocus.relative; | ||
@@ -254,2 +259,6 @@ var info = dt.page.info(); | ||
if ( info.recordsDisplay === 0 ) { | ||
return; | ||
} | ||
// Reverse if needed | ||
@@ -352,2 +361,3 @@ if ( row >= info.recordsDisplay ) { | ||
{ | ||
var that = this; | ||
var dt = this.s.dt; | ||
@@ -369,22 +379,32 @@ var editor = this.c.editor; | ||
editor.inline( this.s.lastFocus.cell.index() ); | ||
editor | ||
.one( 'open.keyTable', function () { | ||
// Remove cancel open | ||
editor.off( 'cancelOpen.keyTable' ); | ||
// Excel style - select all text | ||
$('div.DTE input, div.DTE textarea').select(); | ||
// Excel style - select all text | ||
$('div.DTE input, div.DTE textarea').select(); | ||
// Reduce the keys the Keys listens for | ||
dt.keys.enable( this.c.editorKeys ); | ||
// Reduce the keys the Keys listens for | ||
dt.keys.enable( that.c.editorKeys ); | ||
// On blur of the navigation submit | ||
dt.one( 'key-blur.editor', function () { | ||
if ( editor.displayed() ) { | ||
editor.submit(); | ||
} | ||
} ); | ||
// On blur of the navigation submit | ||
dt.one( 'key-blur.editor', function () { | ||
if ( editor.displayed() ) { | ||
editor.submit(); | ||
} | ||
} ); | ||
// Restore full key navigation on close | ||
editor.one( 'close', function () { | ||
dt.keys.enable( true ); | ||
dt.off( 'key-blur.editor' ); | ||
} ); | ||
// Restore full key navigation on close | ||
editor.one( 'close', function () { | ||
dt.keys.enable( true ); | ||
dt.off( 'key-blur.editor' ); | ||
} ); | ||
} ) | ||
.one( 'cancelOpen.keyTable', function () { | ||
// `preOpen` can cancel the display of the form, so it | ||
// might be that the open event handler isn't needed | ||
editor.off( 'open.keyTable' ); | ||
} ) | ||
.inline( this.s.lastFocus.cell.index() ); | ||
}, | ||
@@ -426,4 +446,6 @@ | ||
var lastFocus = this.s.lastFocus; | ||
if( ! originalEvent) | ||
if ( ! originalEvent) { | ||
originalEvent = null; | ||
} | ||
@@ -461,3 +483,3 @@ if ( ! this.s.enable ) { | ||
that.s.waitingForDraw = false; | ||
that._focus( row, column ); | ||
that._focus( row, column, undefined, originalEvent ); | ||
} ) | ||
@@ -793,22 +815,28 @@ .page( Math.floor( row / pageInfo.length ) ) | ||
div.children().on( 'focus', function (e) { | ||
that._focus( dt.cell(':eq(0)', '0:visible', {page: 'current'}), null, true, e ); | ||
if ( dt.cell(':eq(0)', {page: 'current'}).any() ) { | ||
that._focus( dt.cell(':eq(0)', '0:visible', {page: 'current'}), null, true, e ); | ||
} | ||
} ); | ||
}, | ||
/** | ||
* Update fixed columns if they are enabled and if the cell we are focusing is inside a fixed column | ||
* @param {integer} column Index of the column being changed | ||
* | ||
* Update fixed columns if they are enabled and if the cell we are | ||
* focusing is inside a fixed column | ||
* @param {integer} column Index of the column being changed | ||
* @private | ||
*/ | ||
_updateFixedColumns:function(column){ | ||
var dt = this.s.dt; | ||
var settings = dt.settings()[0]; | ||
_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(); | ||
} | ||
} | ||
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(); | ||
} | ||
} | ||
} | ||
} ); | ||
@@ -879,3 +907,3 @@ | ||
KeyTable.version = "2.2.0"; | ||
KeyTable.version = "2.2.1"; | ||
@@ -882,0 +910,0 @@ |
{ | ||
"name": "datatables.net-keytable", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "KeyTable for DataTables ", | ||
@@ -5,0 +5,0 @@ "files": [ |
# KeyTable for DataTables | ||
This package contains distribution files for the [KeyTable extension](https://datatables.net/extensions/keytable) for [DataTables](https://datatables.net/). Only the core software for this library is contained in this package - to be correctly styled, a styling package for KeyTable must also be included. Styling options include DataTable's native styling, [Bootstrap](http://getboostrap.com) and [Foundation](http://foundation.zurb.com/). | ||
This package contains distribution files for the [KeyTable extension](https://datatables.net/extensions/keytable) for [DataTables](https://datatables.net/). Only the core software for this library is contained in this package - to be correctly styled, a styling package for KeyTable must also be included. Styling options include DataTable's native styling, [Bootstrap](http://getbootstrap.com) and [Foundation](http://foundation.zurb.com/). | ||
@@ -5,0 +5,0 @@ KeyTable allows you to use keyboard navigation on a DataTables enhanced table, like an Excel spreadsheet - a cell shows a focus outline which can be moved using the keyboard or mouse operations. This can be particularly useful in an editable table that uses Editor allowing end users to update data very quickly. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25829
809