Stay organized with collections
Save and categorize content based on your preferences.
blockly > comments > CommentView > addOnCollapseListener
Registers a callback that listens for collapsed-ness changes.
Signature:
addOnCollapseListener(listener: (newCollapse: boolean) => void): void;
Parameters
Parameter |
Type |
Description |
listener |
(newCollapse: boolean) => void |
|
Returns:
void
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["The `addOnCollapseListener` method allows you to register a callback function."],["This callback function is triggered whenever the collapsed state of a comment view changes."],["The listener function receives a boolean argument indicating the new collapsed state of the comment view (`true` for collapsed, `false` for expanded)."],["This method facilitates reacting to comment visibility changes within Blockly projects."]]],["The `addOnCollapseListener` method, part of the `comments.CommentView` class, registers a callback function. This function, provided as a `listener` parameter, is invoked whenever the collapsed state of a comment changes. The `listener` function receives a boolean `newCollapse` parameter, indicating the new collapsed state. The method does not return any value.\n"]]