slickgrid
Advanced tools
Comparing version 2.4.42 to 2.4.43
{ | ||
"name": "slickgrid", | ||
"version": "2.4.42", | ||
"version": "2.4.43", | ||
"description": "A lightning fast JavaScript grid/spreadsheet", | ||
@@ -5,0 +5,0 @@ "main": "slick.core.js", |
@@ -27,3 +27,3 @@ (function ($) { | ||
if (!_grid.getEditorLock().isActive()) { | ||
if (e.which == $.ui.keyCode.ESCAPE) { | ||
if (e.which == Slick.keyCode.ESCAPE) { | ||
if (_copiedRanges) { | ||
@@ -91,2 +91,2 @@ e.preventDefault(); | ||
} | ||
})(jQuery); | ||
})(jQuery); |
/** | ||
* Row Move Manager options: | ||
* cssClass: A CSS class to be added to the menu item container. | ||
* columnId: Column definition id (defaults to "_move") | ||
* cancelEditOnDrag: Do we want to cancel any Editing while dragging a row (defaults to false) | ||
* disableRowSelection: Do we want to disable the row selection? (defaults to false) | ||
* singleRowMove: Do we want a single row move? Setting this to false means that it's a multple row move (defaults to false) | ||
* width: Width of the column | ||
* usabilityOverride: Callback method that user can override the default behavior of the row being moveable or not | ||
* cssClass: A CSS class to be added to the menu item container. | ||
* columnId: Column definition id (defaults to "_move") | ||
* cancelEditOnDrag: Do we want to cancel any Editing while dragging a row (defaults to false) | ||
* disableRowSelection: Do we want to disable the row selection? (defaults to false) | ||
* hideRowMoveShadow: Do we want to hide the row move shadow clone? (defaults to true) | ||
* rowMoveShadowMarginTop: When row move shadow is shown, optional margin-top (defaults to 0) | ||
* rowMoveShadowMarginLeft: When row move shadow is shown, optional margin-left (defaults to 0) | ||
* rowMoveShadowOpacity: When row move shadow is shown, what is its opacity? (defaults to 0.95) | ||
* rowMoveShadowScale: When row move shadow is shown, what is its size scale? (default to 0.75) | ||
* singleRowMove: Do we want a single row move? Setting this to false means that it's a multple row move (defaults to false) | ||
* width: Width of the column | ||
* usabilityOverride: Callback method that user can override the default behavior of the row being moveable or not | ||
* | ||
@@ -32,2 +37,7 @@ */ | ||
disableRowSelection: false, | ||
hideRowMoveShadow: true, | ||
rowMoveShadowMarginTop: 0, | ||
rowMoveShadowMarginLeft: 0, | ||
rowMoveShadowOpacity: 0.95, | ||
rowMoveShadowScale: 0.75, | ||
singleRowMove: false, | ||
@@ -86,2 +96,17 @@ width: 40, | ||
// optionally create a shadow element of the row so that we can see all the time which row exactly we're dragging | ||
if (!options.hideRowMoveShadow) { | ||
var $slickRowElm = $(_grid.getCellNode(cell.row, cell.cell)).closest('.slick-row'); | ||
if ($slickRowElm) { | ||
dd.clonedSlickRow = $slickRowElm.clone(); | ||
dd.clonedSlickRow.addClass('slick-reorder-shadow-row') | ||
.css("marginTop", options.rowMoveShadowMarginTop || 0) | ||
.css("marginLeft", options.rowMoveShadowMarginLeft || 0) | ||
.css("opacity", options.rowMoveShadowOpacity || 0.95) | ||
.css("transform", "scale(" + options.rowMoveShadowScale + ")") | ||
.hide() | ||
.appendTo(_canvas); | ||
} | ||
} | ||
var selectedRows = options.singleRowMove ? [cell.row] : _grid.getSelectedRows(); | ||
@@ -105,2 +130,3 @@ | ||
.css("height", rowHeight * selectedRows.length) | ||
.hide() | ||
.appendTo(_canvas); | ||
@@ -126,4 +152,10 @@ | ||
var top = e.pageY - $(_canvas).offset().top; | ||
dd.selectionProxy.css("top", top - 5); | ||
dd.selectionProxy.css("top", top - 5).show(); | ||
// if the row move shadow is enabled, we'll also make it follow the mouse cursor | ||
if (dd.clonedSlickRow) { | ||
var offsetY = e.pageY - $(_canvas).offset().top; | ||
dd.clonedSlickRow.css("top", offsetY - 6).show(); | ||
} | ||
var insertBefore = Math.max(0, Math.min(Math.round(top / _grid.getOptions().rowHeight), _grid.getDataLength())); | ||
@@ -170,2 +202,6 @@ if (insertBefore !== dd.insertBefore) { | ||
dd.selectionProxy.remove(); | ||
if (dd.clonedSlickRow) { | ||
dd.clonedSlickRow.remove(); | ||
dd.clonedSlickRow = null; | ||
} | ||
@@ -233,2 +269,2 @@ if (dd.canMove) { | ||
} | ||
})(jQuery); | ||
})(jQuery); |
@@ -660,21 +660,21 @@ /*** | ||
this.handleKeyDown = function (e) { | ||
if (e.which == $.ui.keyCode.ENTER && e.ctrlKey) { | ||
if (e.which == Slick.keyCode.ENTER && e.ctrlKey) { | ||
scope.save(); | ||
} else if (e.which == $.ui.keyCode.ESCAPE) { | ||
} else if (e.which == Slick.keyCode.ESCAPE) { | ||
e.preventDefault(); | ||
scope.cancel(); | ||
} else if (e.which == $.ui.keyCode.TAB && e.shiftKey) { | ||
} else if (e.which == Slick.keyCode.TAB && e.shiftKey) { | ||
e.preventDefault(); | ||
args.grid.navigatePrev(); | ||
} else if (e.which == $.ui.keyCode.TAB) { | ||
} else if (e.which == Slick.keyCode.TAB) { | ||
e.preventDefault(); | ||
args.grid.navigateNext(); | ||
} else if (e.which == $.ui.keyCode.LEFT || e.which == $.ui.keyCode.RIGHT) { | ||
} else if (e.which == Slick.keyCode.LEFT || e.which == Slick.keyCode.RIGHT) { | ||
if (args.grid.getOptions().editorCellNavOnLRKeys) { | ||
var cursorPosition = this.selectionStart; | ||
var textLength = this.value.length; | ||
if (e.keyCode === $.ui.keyCode.LEFT && cursorPosition === 0) { | ||
if (e.keyCode === Slick.keyCode.LEFT && cursorPosition === 0) { | ||
args.grid.navigatePrev(); | ||
} | ||
if (e.keyCode === $.ui.keyCode.RIGHT && cursorPosition >= textLength - 1) { | ||
if (e.keyCode === Slick.keyCode.RIGHT && cursorPosition >= textLength - 1) { | ||
args.grid.navigateNext(); | ||
@@ -759,4 +759,4 @@ } | ||
var textLength = this.value.length; | ||
if ((e.keyCode === $.ui.keyCode.LEFT && cursorPosition > 0) || | ||
e.keyCode === $.ui.keyCode.RIGHT && cursorPosition < textLength - 1) { | ||
if ((e.keyCode === Slick.keyCode.LEFT && cursorPosition > 0) || | ||
e.keyCode === Slick.keyCode.RIGHT && cursorPosition < textLength - 1) { | ||
e.stopImmediatePropagation(); | ||
@@ -767,3 +767,3 @@ } | ||
function handleKeydownLRNoNav(e) { | ||
if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) { | ||
if (e.keyCode === Slick.keyCode.LEFT || e.keyCode === Slick.keyCode.RIGHT) { | ||
e.stopImmediatePropagation(); | ||
@@ -770,0 +770,0 @@ } |
@@ -37,3 +37,3 @@ /*** | ||
return "<span class='percent-complete-bar' style='background:" + color + ";width:" + value + "%'></span>"; | ||
return "<span class='percent-complete-bar' style='background:" + color + ";width:" + value + "%' title='" + value + "%'></span>"; | ||
} | ||
@@ -40,0 +40,0 @@ |
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
4606545
145
102009