Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: few minor fixes on plugin with menus #636

Merged
merged 1 commit into from
Sep 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions controls/slick.gridmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@
}
};

// when a grid changes from a regular grid to a frozen grid, we need to destroy & recreate the grid menu
// we do this change because the Grid Menu is on the left container on a regular grid but is on the right container on a frozen grid
// when a grid optionally changes from a regular grid to a frozen grid, we need to destroy & recreate the grid menu
// we do this change because the Grid Menu is on the left container for a regular grid, it is however on the right container for a frozen grid
grid.onSetOptions.subscribe(function (e, args) {
if (args && args.optionsBefore && args.optionsAfter) {
var switchedFromRegularToFrozen = args.optionsBefore.frozenColumn >= 0 && args.optionsAfter.frozenColumn === -1;
Expand Down Expand Up @@ -304,7 +304,7 @@
}

var $li = $("<div class='slick-gridmenu-item'></div>")
.data("command", item.command || '')
.data("command", item.command !== undefined ? item.command : "")
.data("item", item)
.on("click", handleMenuItemClick)
.appendTo($customMenu);
Expand Down
6 changes: 3 additions & 3 deletions plugins/slick.cellmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
var optionItems = _cellMenuProperties.optionItems || [];

// make sure there's at least something to show before creating the Cell Menu
if (!columnDef || !columnDef.cellMenu || (!commandItems.length && optionItems.length)) {
if (!columnDef || !columnDef.cellMenu || (!commandItems.length && !optionItems.length)) {
return;
}

Expand Down Expand Up @@ -459,7 +459,7 @@
}

var $li = $('<div class="slick-cell-menu-item"></div>')
.data("option", item.option || "")
.data("option", item.option !== undefined ? item.option : "")
.data("item", item)
.on("click", handleMenuItemOptionClick)
.appendTo(optionMenuElm);
Expand Down Expand Up @@ -539,7 +539,7 @@
}

var $li = $('<div class="slick-cell-menu-item"></div>')
.data("command", item.command || "")
.data("command", item.command !== undefined ? item.command : "")
.data("item", item)
.on("click", handleMenuItemCommandClick)
.appendTo(commandMenuElm);
Expand Down
6 changes: 3 additions & 3 deletions plugins/slick.contextmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
var optionItems = _contextMenuProperties.optionItems || [];

// make sure there's at least something to show before creating the Context Menu
if (!columnDef || (!isColumnCommandAllowed && !isColumnOptionAllowed) || (!commandItems.length && optionItems.length)) {
if (!columnDef || (!isColumnCommandAllowed && !isColumnOptionAllowed) || (!commandItems.length && !optionItems.length)) {
return;
}

Expand Down Expand Up @@ -415,7 +415,7 @@
}

var $li = $('<div class="slick-context-menu-item"></div>')
.data("option", item.option || "")
.data("option", item.option !== undefined ? item.option : "")
.data("item", item)
.on("click", handleMenuItemOptionClick)
.appendTo(optionMenuElm);
Expand Down Expand Up @@ -495,7 +495,7 @@
}

var $li = $('<div class="slick-context-menu-item"></div>')
.data("command", item.command || "")
.data("command", item.command !== undefined ? item.command : "")
.data("item", item)
.on("click", handleMenuItemCommandClick)
.appendTo(commandMenuElm);
Expand Down
2 changes: 1 addition & 1 deletion plugins/slick.headermenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
}

var $li = $("<div class='slick-header-menuitem'></div>")
.data("command", item.command || '')
.data("command", item.command !== undefined ? item.command : "")
.data("column", columnDef)
.data("item", item)
.on("click", handleMenuItemClick)
Expand Down