Skip to content

Commit

Permalink
Fix notification on child value changed
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Oct 10, 2023
1 parent 6d55e5c commit ad10eed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/layertree/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export function LayertreeController($scope, $rootScope, $attrs) {
/**
* Return the current state.
*
* @returns {string} 'on', 'off', 'indeterminate'.
* @returns {string} 'on', 'off', 'indeterminate', or '' if the children are not initialized.
*/
LayertreeController.prototype.getState = function () {
return this.state_;
Expand Down Expand Up @@ -302,7 +302,7 @@ LayertreeController.prototype.refreshState = function (opt_onChild, opt_broadcas
/**
* Return the current state, calculate on all its children recursively.
*
* @returns {string} 'on', 'off' or 'indeterminate'.
* @returns {string} 'on', 'off', 'indeterminate', or '' if the children are not initialized.
*/
LayertreeController.prototype.getCalculateState = function () {
const group = /** @type {import('gmf/themes').GmfGroup} */ (this.node);
Expand All @@ -314,7 +314,7 @@ LayertreeController.prototype.getCalculateState = function () {
/** @type {string} */
let previousChildState;
this.children.some((child) => {
childState = child.getCalculateState();
childState = child.getState();
if (previousChildState) {
if (previousChildState !== childState) {
childState = 'indeterminate';
Expand Down

0 comments on commit ad10eed

Please sign in to comment.