Skip to content

Commit

Permalink
Merge pull request #1707 from mlankamp/typing
Browse files Browse the repository at this point in the history
Updated typings: setCheckbox method signature to include indeterminate parameter
  • Loading branch information
xeolabs authored Oct 22, 2024
2 parents 8b80b50 + 3b98f07 commit 1c00686
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,15 @@ <h3>Resources</h3>
isChecked: (element) => {
return element.checked;
},
setCheckbox: (nodeId, checked) => {
setCheckbox: (nodeId, checked, indeterminate) => {
const checkbox = document.getElementById(`cb-${nodeId}`);
if (checkbox) {
if (checked !== checkbox.checked) {
checkbox.checked = checked;
}
if (indeterminate !== checkbox.indeterminate) {
checkbox.indeterminate = indeterminate;
}
}
},
setXRayed: (nodeId, xrayed) => {
Expand Down
2 changes: 1 addition & 1 deletion types/plugins/TreeViewPlugin/renderService.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export declare interface ITreeViewRenderService {
* @param nodeId {String} The node id.
* @param checked {Boolean} Whether the node is checked.
*/
setCheckbox(nodeId: string, checked: boolean): void;
setCheckbox(nodeId: string, checked: boolean, indeterminate: boolean): void;

/**
* Sets the node's xrayed state.
Expand Down

0 comments on commit 1c00686

Please sign in to comment.