slickgrid
Advanced tools
Comparing version 2.3.17 to 2.3.18
@@ -105,3 +105,3 @@ /*** | ||
hideForceFitButton: false, | ||
hideSyncResizeButton: false, | ||
hideSyncResizeButton: false, | ||
fadeSpeed: 250, | ||
@@ -121,3 +121,3 @@ forceFitTitle: "Force fit columns", | ||
var enableResizeHeaderRow = (_options.gridMenu && _options.gridMenu.resizeOnShowHeaderRow != undefined) ? _options.gridMenu.resizeOnShowHeaderRow : _defaults.resizeOnShowHeaderRow; | ||
if(enableResizeHeaderRow) { | ||
if(enableResizeHeaderRow && _options.showHeaderRow) { | ||
var $headerrow = $('.slick-headerrow'); | ||
@@ -124,0 +124,0 @@ $headerrow.attr('style', 'width: calc(100% - ' + gridMenuWidth +'px)'); |
{ | ||
"name": "slickgrid", | ||
"version": "2.3.17", | ||
"version": "2.3.18", | ||
"description": "A lightning fast JavaScript grid/spreadsheet", | ||
@@ -5,0 +5,0 @@ "main": "slick.core.js", |
@@ -63,2 +63,20 @@ (function ($) { | ||
function rangesAreEqual(range1, range2) { | ||
var areDifferent = (range1.length !== range2.length); | ||
if (!areDifferent) { | ||
for (var i = 0; i < range1.length; i++) { | ||
if ( | ||
range1[i].fromCell !== range2[i].fromCell | ||
|| range1[i].fromRow !== range2[i].fromRow | ||
|| range1[i].toCell !== range2[i].toCell | ||
|| range1[i].toRow !== range2[i].toRow | ||
) { | ||
areDifferent = true; | ||
break; | ||
} | ||
} | ||
} | ||
return !areDifferent; | ||
} | ||
function setSelectedRanges(ranges) { | ||
@@ -68,4 +86,7 @@ // simple check for: empty selection didn't change, prevent firing onSelectedRangesChanged | ||
// if range has not changed, don't fire onSelectedRangesChanged | ||
var rangeHasChanged = !rangesAreEqual(_ranges, ranges); | ||
_ranges = removeInvalidRanges(ranges); | ||
_self.onSelectedRangesChanged.notify(_ranges); | ||
if (rangeHasChanged) { _self.onSelectedRangesChanged.notify(_ranges); } | ||
} | ||
@@ -72,0 +93,0 @@ |
@@ -159,3 +159,3 @@ /*** | ||
// Check it is a parent item | ||
if (topMostItem._parent == undefined) | ||
if (topMostItem && topMostItem._parent == undefined) | ||
{ | ||
@@ -179,3 +179,3 @@ // This is a standard row as we have no parent. | ||
// If we are a detailView and we are about to go out of cache view | ||
if(bottomMostItem._parent !== undefined) | ||
if (bottomMostItem && bottomMostItem._parent !== undefined) | ||
{ | ||
@@ -182,0 +182,0 @@ saveDetailView(bottomMostItem._parent); |
@@ -30,9 +30,6 @@ /*** | ||
this.init = function () { | ||
var navOnLR = args.grid.getOptions().editorCellNavOnLRKeys; | ||
$input = $("<INPUT type=text class='editor-text' />") | ||
.appendTo(args.container) | ||
.on("keydown.nav", function (e) { | ||
if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) { | ||
e.stopImmediatePropagation(); | ||
} | ||
}) | ||
.on("keydown.nav", navOnLR ? handleKeydownLRNav : handleKeydownLRNoNav) | ||
.focus() | ||
@@ -100,12 +97,8 @@ .select(); | ||
this.init = function () { | ||
$input = $("<INPUT type=text class='editor-text' />"); | ||
$input.on("keydown.nav", function (e) { | ||
if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) { | ||
e.stopImmediatePropagation(); | ||
} | ||
}); | ||
$input.appendTo(args.container); | ||
$input.focus().select(); | ||
var navOnLR = args.grid.getOptions().editorCellNavOnLRKeys; | ||
$input = $("<INPUT type=text class='editor-text' />") | ||
.appendTo(args.container) | ||
.on("keydown.nav", navOnLR ? handleKeydownLRNav : handleKeydownLRNoNav) | ||
.focus() | ||
.select(); | ||
}; | ||
@@ -170,12 +163,8 @@ | ||
this.init = function () { | ||
$input = $("<INPUT type=text class='editor-text' />"); | ||
$input.on("keydown.nav", function (e) { | ||
if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) { | ||
e.stopImmediatePropagation(); | ||
} | ||
}); | ||
$input.appendTo(args.container); | ||
$input.focus().select(); | ||
var navOnLR = args.grid.getOptions().editorCellNavOnLRKeys; | ||
$input = $("<INPUT type=text class='editor-text' />") | ||
.appendTo(args.container) | ||
.on("keydown.nav", navOnLR ? handleKeydownLRNav : handleKeydownLRNoNav) | ||
.focus() | ||
.select(); | ||
}; | ||
@@ -222,3 +211,3 @@ | ||
} | ||
var decPlaces = getDecimalPlaces(); | ||
@@ -547,2 +536,3 @@ if (decPlaces !== null | ||
var $container = $("body"); | ||
var navOnLR = args.grid.getOptions().editorCellNavOnLRKeys; | ||
@@ -560,3 +550,3 @@ $wrapper = $("<DIV style='z-index:10000;position:absolute;background:white;padding:5px;border:3px solid gray; -moz-border-radius:10px; border-radius:10px;'/>") | ||
$wrapper.find("button:last").on("click", this.cancel); | ||
$input.on("keydown", this.handleKeyDown); | ||
$input.on("keydown", this.handleKeyDown); | ||
@@ -579,2 +569,13 @@ scope.position(args.position); | ||
args.grid.navigateNext(); | ||
} else if (e.which == $.ui.keyCode.LEFT || e.which == $.ui.keyCode.RIGHT) { | ||
if (args.grid.getOptions().editorCellNavOnLRKeys) { | ||
var cursorPosition = this.selectionStart; | ||
var textLength = this.value.length; | ||
if (e.keyCode === $.ui.keyCode.LEFT && cursorPosition === 0) { | ||
args.grid.navigatePrev(); | ||
} | ||
if (e.keyCode === $.ui.keyCode.RIGHT && cursorPosition >= textLength-1) { | ||
args.grid.navigateNext(); | ||
} | ||
} | ||
} | ||
@@ -647,2 +648,23 @@ }; | ||
} | ||
/* | ||
* Depending on the value of Grid option 'editorCellNavOnLRKeys', us | ||
* Navigate to the cell on the left if the cursor is at the beginning of the input string | ||
* and to the right cell if it's at the end. Otherwise, move the cursor within the text | ||
*/ | ||
function handleKeydownLRNav(e) { | ||
var cursorPosition = this.selectionStart; | ||
var textLength = this.value.length; | ||
if ((e.keyCode === $.ui.keyCode.LEFT && cursorPosition > 0) || | ||
e.keyCode === $.ui.keyCode.RIGHT && cursorPosition < textLength-1) { | ||
e.stopImmediatePropagation(); | ||
} | ||
} | ||
function handleKeydownLRNoNav(e) { | ||
if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) { | ||
e.stopImmediatePropagation(); | ||
} | ||
} | ||
})(jQuery); |
@@ -47,3 +47,3 @@ (function ($) { | ||
function defaultGroupCellFormatter(row, cell, value, columnDef, item) { | ||
function defaultGroupCellFormatter(row, cell, value, columnDef, item, grid) { | ||
if (!options.enableExpandCollapse) { | ||
@@ -66,4 +66,4 @@ return item.title; | ||
function defaultTotalsCellFormatter(row, cell, value, columnDef, item) { | ||
return (columnDef.groupTotalsFormatter && columnDef.groupTotalsFormatter(item, columnDef)) || ""; | ||
function defaultTotalsCellFormatter(row, cell, value, columnDef, item, grid) { | ||
return (columnDef.groupTotalsFormatter && columnDef.groupTotalsFormatter(item, columnDef, grid)) || ""; | ||
} | ||
@@ -70,0 +70,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
4805953
91304