setTreeElementsBackgroundBlur function

void setTreeElementsBackgroundBlur(
  1. Element element,
  2. String className
)

Implementation

void setTreeElementsBackgroundBlur(Element element, String className) {
  if (isEmptyString(className, trim: true)) return;

  className = className.trim();

  var levels = [1, 2, 3, 4];

  if (element.classes.contains(className)) {
    setElementBackgroundBlur(element, 3);
  } else {
    for (var level in levels) {
      if (element.classes.contains('$className-$level')) {
        setElementBackgroundBlur(element, level * 3);
      }
    }
  }

  var elements = element.querySelectorAll('.$className');
  for (var e in elements) {
    setElementBackgroundBlur(e, 3);
  }

  for (var level in levels) {
    var elements = element.querySelectorAll('.$className-$level');
    for (var e in elements) {
      setElementBackgroundBlur(e, level * 3);
    }
  }
}