slickgrid
Advanced tools
Comparing version 2.4.1 to 2.4.2
@@ -16,4 +16,4 @@ /*** | ||
* // the last 2 checkboxes titles | ||
* hideForceFitButton: false, // show/hide checkbox near the end "Force Fit Columns" (default:false) | ||
* hideSyncResizeButton: false, // show/hide checkbox near the end "Synchronous Resize" (default:false) | ||
* hideForceFitButton: false, // show/hide checkbox near the end "Force Fit Columns" (default:false) | ||
* hideSyncResizeButton: false, // show/hide checkbox near the end "Synchronous Resize" (default:false) | ||
* forceFitTitle: "Force fit columns", // default to "Force fit columns" | ||
@@ -34,2 +34,3 @@ * headerColumnValueExtractor: "Extract the column label" // default to column.name | ||
var _grid = grid; | ||
var _options = options; | ||
var $list; | ||
@@ -45,6 +46,6 @@ var $menu; | ||
hideForceFitButton: false, | ||
hideSyncResizeButton: false, | ||
hideSyncResizeButton: false, | ||
forceFitTitle: "Force fit columns", | ||
syncResizeTitle: "Synchronous resize", | ||
headerColumnValueExtractor: | ||
headerColumnValueExtractor: | ||
function (columnDef) { | ||
@@ -58,3 +59,3 @@ return columnDef.name; | ||
grid.onColumnsReordered.subscribe(updateColumnOrder); | ||
options = $.extend({}, defaults, options); | ||
_options = $.extend({}, defaults, options); | ||
@@ -65,4 +66,4 @@ $menu = $("<div class='slick-columnpicker' style='display:none' />").appendTo(document.body); | ||
// user could pass a title on top of the columns list | ||
if(options.columnPickerTitle || (options.columnPicker && options.columnPicker.columnTitle)) { | ||
var columnTitle = options.columnPickerTitle || options.columnPicker.columnTitle; | ||
if(_options.columnPickerTitle || (_options.columnPicker && _options.columnPicker.columnTitle)) { | ||
var columnTitle = _options.columnPickerTitle || _options.columnPicker.columnTitle; | ||
var $title = $("<div class='title'/>").append(columnTitle); | ||
@@ -86,3 +87,3 @@ $title.appendTo($menu); | ||
$(document.body).off("mousedown", handleBodyMouseDown); | ||
$("div.slick-columnpicker").hide(options.fadeSpeed); | ||
$("div.slick-columnpicker").hide(_options.fadeSpeed); | ||
$menu.remove(); | ||
@@ -93,3 +94,3 @@ } | ||
if (($menu && $menu[0] != e.target && !$.contains($menu[0], e.target)) || e.target.className == "close") { | ||
$menu.hide(options.fadeSpeed); | ||
$menu.hide(_options.fadeSpeed); | ||
} | ||
@@ -115,4 +116,4 @@ } | ||
if (options.columnPicker.headerColumnValueExtractor) { | ||
columnLabel = options.columnPicker.headerColumnValueExtractor(columns[i]); | ||
if (_options && _options.columnPicker && _options.columnPicker.headerColumnValueExtractor) { | ||
columnLabel = _options.columnPicker.headerColumnValueExtractor(columns[i]); | ||
} else { | ||
@@ -128,8 +129,8 @@ columnLabel = defaults.headerColumnValueExtractor(columns[i]); | ||
if (options.columnPicker && (!options.columnPicker.hideForceFitButton || !options.columnPicker.hideSyncResizeButton)) { | ||
if (_options.columnPicker && (!_options.columnPicker.hideForceFitButton || !_options.columnPicker.hideSyncResizeButton)) { | ||
$("<hr/>").appendTo($list); | ||
} | ||
if (!(options.columnPicker && options.columnPicker.hideForceFitButton)) { | ||
var forceFitTitle = (options.columnPicker && options.columnPicker.forceFitTitle) || options.forceFitTitle; | ||
if (!(_options.columnPicker && _options.columnPicker.hideForceFitButton)) { | ||
var forceFitTitle = (_options.columnPicker && _options.columnPicker.forceFitTitle) || _options.forceFitTitle; | ||
$li = $("<li />").appendTo($list); | ||
@@ -146,4 +147,4 @@ $input = $("<input type='checkbox' />").data("option", "autoresize"); | ||
if (!(options.columnPicker && options.columnPicker.hideSyncResizeButton)) { | ||
var syncResizeTitle = (options.columnPicker && options.columnPicker.syncResizeTitle) || options.syncResizeTitle; | ||
if (!(_options.columnPicker && _options.columnPicker.hideSyncResizeButton)) { | ||
var syncResizeTitle = (_options.columnPicker && _options.columnPicker.syncResizeTitle) || _options.syncResizeTitle; | ||
$li = $("<li />").appendTo($list); | ||
@@ -164,3 +165,3 @@ $input = $("<input type='checkbox' />").data("option", "syncresize"); | ||
.css("max-height", $(window).height() - e.pageY -10) | ||
.fadeIn(options.fadeSpeed); | ||
.fadeIn(_options.fadeSpeed); | ||
@@ -167,0 +168,0 @@ $list.appendTo($menu); |
@@ -44,2 +44,3 @@ /*** | ||
* title: Menu item text. | ||
* divider: Whether the current item is a divider, not an actual command. | ||
* disabled: Whether the item is disabled. | ||
@@ -127,3 +128,3 @@ * tooltip: Item tooltip. | ||
$header.attr('style', 'width: calc(100% - ' + gridMenuWidth +'px)'); | ||
// subscribe to the grid, when it's destroyed, we should also destroy the Grid Menu | ||
@@ -205,2 +206,7 @@ grid.onBeforeDestroy.subscribe(destroy); | ||
if (item.divider) { | ||
$li.addClass("slick-gridmenu-item-divider"); | ||
continue; | ||
} | ||
if (item.tooltip) { | ||
@@ -328,3 +334,3 @@ $li.attr("title", item.tooltip); | ||
if (item.disabled) { | ||
if (item.disabled || item.divider) { | ||
return; | ||
@@ -331,0 +337,0 @@ } |
{ | ||
"name": "slickgrid", | ||
"version": "2.4.1", | ||
"version": "2.4.2", | ||
"description": "A lightning fast JavaScript grid/spreadsheet", | ||
@@ -5,0 +5,0 @@ "main": "slick.core.js", |
@@ -49,2 +49,3 @@ (function ($) { | ||
* title: Menu item text. | ||
* divider: Whether the current item is a divider, not an actual command. | ||
* disabled: Whether the item is disabled. | ||
@@ -216,2 +217,7 @@ * tooltip: Item tooltip. | ||
if (item.divider) { | ||
$li.addClass("slick-header-menuitem-divider"); | ||
continue; | ||
} | ||
if (item.tooltip) { | ||
@@ -246,5 +252,5 @@ $li.attr("title", item.tooltip); | ||
leftPos = leftPos - options.minWidth + options.autoAlignOffset; | ||
} | ||
} | ||
} | ||
$menu | ||
@@ -270,3 +276,3 @@ .offset({ top: $(this).offset().top + $(this).height(), left: leftPos }); | ||
if (item.disabled) { | ||
if (item.disabled || item.divider) { | ||
return; | ||
@@ -273,0 +279,0 @@ } |
@@ -110,2 +110,3 @@ /*** | ||
useSimpleViewportCalc: false, | ||
alwaysRenderColumn: true, | ||
toolTip: '', | ||
@@ -576,2 +577,3 @@ width: 30, | ||
sortable: false, | ||
alwaysRenderColumn: _options.alwaysRenderColumn, | ||
cssClass: _options.cssClass, | ||
@@ -578,0 +580,0 @@ formatter: detailSelectionFormatter |
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
3515357
92021