Skip to content

Commit

Permalink
4a14b6fb93901695a6dc88d541e8e409efcac8ce New: `-type button-group-sel…
Browse files Browse the repository at this point in the history
…ector` can now select a button group using the group's container element.

https://datatables.net/forums/discussion/78684

Sync to source repo @4a14b6fb93901695a6dc88d541e8e409efcac8ce
  • Loading branch information
dtbuild committed Apr 11, 2024
1 parent 015eb13 commit 7a8f8c2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion datatables.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
],
"src-repo": "http://github.com/DataTables/Buttons",
"last-tag": "3.0.1",
"last-sync": "919d14b1f89aba2f84090b4a174f07bb3af23402"
"last-sync": "4a14b6fb93901695a6dc88d541e8e409efcac8ce"
}
8 changes: 8 additions & 0 deletions js/dataTables.buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -1722,6 +1722,14 @@ Buttons.instanceSelector = function (group, buttons) {
// Index selector
ret.push(buttons[input].inst);
}
else if (typeof input === 'object' && input.nodeName) {
// Element selector
for (var j = 0; j < buttons.length; j++) {
if (buttons[j].inst.dom.container[0] === input) {
ret.push(buttons[j].inst);
}
}
}
else if (typeof input === 'object') {
// Actual instance selector
ret.push(input);
Expand Down
2 changes: 1 addition & 1 deletion js/dataTables.buttons.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dataTables.buttons.min.mjs

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions js/dataTables.buttons.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1682,6 +1682,14 @@ Buttons.instanceSelector = function (group, buttons) {
// Index selector
ret.push(buttons[input].inst);
}
else if (typeof input === 'object' && input.nodeName) {
// Element selector
for (var j = 0; j < buttons.length; j++) {
if (buttons[j].inst.dom.container[0] === input) {
ret.push(buttons[j].inst);
}
}
}
else if (typeof input === 'object') {
// Actual instance selector
ret.push(input);
Expand Down

0 comments on commit 7a8f8c2

Please sign in to comment.