Calculate and update which pages are visible,
possibly updating CSS classes on the pages
@param {boolean} updateClasses Wheter to update page CSS classes as well
@returns {void}
1819
function (updateClasses) {
            var i, len, $page,
                state = this.state,
                visibleRange = this.calculateVisibleRange(),
                fullyVisibleRange = this.calculateFullyVisibleRange();
            state.visiblePages.length = 0;
            state.fullyVisiblePages.length = 0;
            for (i = 0, len = this.$pages.length; i < len; ++i) {
                $page = this.$pages.eq(i);
                if (i < visibleRange.min || i > visibleRange.max) {
                    if (updateClasses && $page.hasClass(CSS_CLASS_PAGE_VISIBLE)) {
                        $page.removeClass(CSS_CLASS_PAGE_VISIBLE);
                    }
                } else {
                    if (updateClasses && !$page.hasClass(CSS_CLASS_PAGE_VISIBLE)) {
                        $page.addClass(CSS_CLASS_PAGE_VISIBLE);
                    }
                    state.visiblePages.push(i + 1);
                }
                if (i >= fullyVisibleRange.min && i <= fullyVisibleRange.max) {
                    state.fullyVisiblePages.push(i + 1);
                }
            }
        }
952969
@Override
    protected void updateVisibility(boolean visible, boolean activated) {
        super.updateVisibility(visible, activated);

        if (registeredComponents != null) {
            for (BaseUIComponent component : registeredComponents) {
                if (!visible) {
                    component.setAttribute(Constants.ATTR_VISIBLE, component.isVisible());
                    component.setVisible(false);
                } else {
                    component.setVisible((Boolean) component.getAttribute(Constants.ATTR_VISIBLE));
                }
            }
        }

        if (visible) {
            checkBusy();
        }

    }
1186310
protected function update_course_sections_visibility($numsections) {
        global $DB;

        $backupinfo = $this->step->get_task()->get_info();
        foreach ($backupinfo->sections as $key => $section) {
            // For each section from the backup file check if it was restored and if was "orphaned" in the original
            // course and mark it as hidden. This will leave all activities in it visible and available just as it was
            // in the original course.
            // Exception is when we restore with merging and the course already had a section with this section number,
            // in this case we don't modify the visibility.
            if ($this->step->get_task()->get_setting_value($key . '_included')) {
                $sectionnum = (int)$section->title;
                if ($sectionnum > $numsections && $sectionnum > $this->originalnumsections) {
                    $DB->execute("UPDATE {course_sections} SET visible = 0 WHERE course = ? AND section = ?",
                        [$this->step->get_task()->get_courseid(), $sectionnum]);
                }
            }
        }
    }
962304
public function updateCMSTreeClasses(&$classes)
    {
        if ($this->owner->getField('Disabled')) {
            $classes .= ' is-disabled';
        } elseif ($this->owner->getField('Cached')) {
            $classes .= ' is-cached';
        }
    }
622927
function updateClassInstance(current, workInProgress, renderExpirationTime) {
    var instance = workInProgress.stateNode;
    resetInputPointers(workInProgress, instance);

    var oldProps = workInProgress.memoizedProps;
    var newProps = workInProgress.pendingProps;
    if (!newProps) {
      // If there aren't any new props, then we'll reuse the memoized props.
      // This could be from already completed work.
      newProps = oldProps;
      !(newProps != null) ? invariant(false, 'There should always be pending or memoized props. This error is likely caused by a bug in React. Please file an issue.') : void 0;
    }
    var oldContext = instance.context;
    var newUnmaskedContext = getUnmaskedContext(workInProgress);
    var newContext = getMaskedContext(workInProgress, newUnmaskedContext);

    // Note: During these life-cycles, instance.props/instance.state are what
    // ever the previously attempted to render - not the "current". However,
    // during componentDidUpdate we pass the "current" props.

    if (typeof instance.componentWillReceiveProps === 'function' && (oldProps !== newProps || oldContext !== newContext)) {
      callComponentWillReceiveProps(workInProgress, instance, newProps, newContext);
    }

    // Compute the next state using the memoized state and the update queue.
    var oldState = workInProgress.memoizedState;
    // TODO: Previous state can be null.
    var newState = void 0;
    if (workInProgress.updateQueue !== null) {
      newState = processUpdateQueue(current, workInProgress, workInProgress.updateQueue, instance, newProps, renderExpirationTime);
    } else {
      newState = oldState;
    }

    if (oldProps === newProps && oldState === newState && !hasContextChanged() && !(workInProgress.updateQueue !== null && workInProgress.updateQueue.hasForceUpdate)) {
      // If an update was already in progress, we should schedule an Update
      // effect even though we're bailing out, so that cWU/cDU are called.
      if (typeof instance.componentDidUpdate === 'function') {
        if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
          workInProgress.effectTag |= Update;
        }
      }
      return false;
    }

    var shouldUpdate = checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext);

    if (shouldUpdate) {
      if (typeof instance.componentWillUpdate === 'function') {
        startPhaseTimer(workInProgress, 'componentWillUpdate');
        instance.componentWillUpdate(newProps, newState, newContext);
        stopPhaseTimer();

        // Simulate an async bailout/interruption by invoking lifecycle twice.
        if (debugRenderPhaseSideEffects) {
          instance.componentWillUpdate(newProps, newState, newContext);
        }
      }
      if (typeof instance.componentDidUpdate === 'function') {
        workInProgress.effectTag |= Update;
      }
    } else {
      // If an update was already in progress, we should schedule an Update
      // effect even though we're bailing out, so that cWU/cDU are called.
      if (typeof instance.componentDidUpdate === 'function') {
        if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
          workInProgress.effectTag |= Update;
        }
      }

      // If shouldComponentUpdate returned false, we should still update the
      // memoized props/state to indicate that this work can be reused.
      memoizeProps(workInProgress, newProps);
      memoizeState(workInProgress, newState);
    }

    // Update the existing instance's state, props, and context pointers even
    // if shouldComponentUpdate returns false.
    instance.props = newProps;
    instance.state = newState;
    instance.context = newContext;

    return shouldUpdate;
  }
308495
function (forceUpdatePaddings) {
            var state = this.state,
                pages = state.pages,
                rows = state.rows,
                scrollTop = this.$viewport.scrollTop(),
                scrollLeft = this.$viewport.scrollLeft(),
                rowIndex = 0,
                lastY1 = 0,
                rightmostPageIndex = 0,
                bottommostPageIndex = 0,
                i,
                len,
                page,
                pageEl,
                $pageEl;

            rows.length = state.sumWidths = state.sumHeights = state.totalWidth = state.totalHeight = 0;
            state.widestPage.totalActualWidth = state.tallestPage.totalActualHeight = 0;

            // update the x/y positions and sizes of each page
            // this is basically used as a cache, since accessing the DOM is slow
            for (i = 0, len = this.$pages.length; i < len; ++i) {
                $pageEl = this.$pages.eq(i);
                pageEl = $pageEl[0];
                page = pages[i];
                if (!page || forceUpdatePaddings) {
                    $pageEl.css('padding', '');
                    page = {
                        index: i,
                        // only get paddings on the first updatePageStates
                        // @TODO: look into using numeric versions of these styles in IE for better perf
                        paddingLeft: parseFloat($pageEl.css(STYLE_PADDING_LEFT)),
                        paddingRight: parseFloat($pageEl.css(STYLE_PADDING_RIGHT)),
                        paddingTop: parseFloat($pageEl.css(STYLE_PADDING_TOP)),
                        paddingBottom: parseFloat($pageEl.css(STYLE_PADDING_BOTTOM))
                    };
                }

                if (!page.actualWidth) {
                    page.actualWidth = parseFloat(pageEl.getAttribute('data-width'));
                }
                if (!page.actualHeight) {
                    page.actualHeight = parseFloat(pageEl.getAttribute('data-height'));
                }

                page.totalActualWidth = page.actualWidth + page.paddingLeft + page.paddingRight;
                page.totalActualHeight = page.actualHeight + page.paddingTop + page.paddingBottom;

                page.width = pageEl.offsetWidth;
                page.height = pageEl.offsetHeight;
                page.x0 = pageEl.offsetLeft;
                page.y0 = pageEl.offsetTop;

                page.x1 = page.width + page.x0;
                page.y1 = page.height + page.y0;

                // it is in the same rowIndex as the prev if y0 >= prev rowIndex max y1
                // @NOTE: we add two pixels to y0, because sometimes there
                // seems to be a little overlap #youcantexplainthat
                // @TODO: #explainthat
                if (lastY1 && getMaxY1InRow(pages, rows[rowIndex]) <= page.y0 + 2) {
                    rowIndex++;
                }
                lastY1 = page.y1;
                if (!rows[rowIndex]) {
                    rows[rowIndex] = [];
                }
                // all pages are not created equal
                if (page.totalActualWidth > state.widestPage.totalActualWidth) {
                    state.widestPage = page;
                }
                if (page.totalActualHeight > state.tallestPage.totalActualHeight) {
                    state.tallestPage = page;
                }
                state.sumWidths += page.width;
                state.sumHeights += page.height;
                page.rowIndex = rowIndex;
                pages[i] = page;
                rows[rowIndex].push(i);

                if (pages[rightmostPageIndex].x0 + pages[rightmostPageIndex].width < page.x0 + page.width) {
                    rightmostPageIndex = i;
                }
                if (pages[bottommostPageIndex].y0 + pages[bottommostPageIndex].height < page.y0 + page.height) {
                    bottommostPageIndex = i;
                }
            }

            state.totalWidth = pages[rightmostPageIndex].x0 + pages[rightmostPageIndex].width;
            state.totalHeight = pages[bottommostPageIndex].y0 + pages[bottommostPageIndex].height;
            state.scrollTop = scrollTop;
            state.scrollLeft = scrollLeft;
            this.setCurrentPage(this.calculateCurrentPage());
        }
499783
function updateDragger(isDraggable) {
        if (isDraggable) {
            if (!dragger) {
                $el.addClass(CSS_CLASS_DRAGGABLE);
                dragger = scope.createComponent('dragger');
                dragger.init(config.$viewport);
            }
        } else {
            if (dragger) {
                $el.removeClass(CSS_CLASS_DRAGGABLE);
                scope.destroyComponent(dragger);
                dragger = null;
            }
        }
    }
905859
function update() {
    var element = this.element,
        options = this.options,
        isImg = this.isImg;

    // Destroy viewer if the target image was deleted

    if (isImg && !element.parentNode) {
      return this.destroy();
    }

    var images = [];

    forEach(isImg ? [element] : element.querySelectorAll('img'), function (image) {
      if (options.filter) {
        if (options.filter(image)) {
          images.push(image);
        }
      } else {
        images.push(image);
      }
    });

    if (!images.length) {
      return this;
    }

    this.images = images;
    this.length = images.length;

    if (this.ready) {
      var indexes = [];

      forEach(this.items, function (item, i) {
        var img = item.querySelector('img');
        var image = images[i];

        if (image) {
          if (image.src !== img.src) {
            indexes.push(i);
          }
        } else {
          indexes.push(i);
        }
      });

      setStyle(this.list, {
        width: 'auto'
      });

      this.initList();

      if (this.isShown) {
        if (this.length) {
          if (this.viewed) {
            var index = indexes.indexOf(this.index);

            if (index >= 0) {
              this.viewed = false;
              this.view(Math.max(this.index - (index + 1), 0));
            } else {
              addClass(this.items[this.index], CLASS_ACTIVE);
            }
          }
        } else {
          this.image = null;
          this.viewed = false;
          this.index = 0;
          this.imageData = null;
          this.canvas.innerHTML = '';
          this.title.innerHTML = '';
        }
      }
    } else {
      this.build();
    }

    return this;
  }
885705
protected function updateProductClass()
    {
        $this->controlAccess('product_class_edit');

        if ($this->product_class->update($this->data_product_class['product_class_id'], $this->getSubmitted())) {
            $this->redirect('admin/content/product-class', $this->text('Product class has been updated'), 'success');
        }

        $this->redirect('', $this->text('Product class has not been updated'), 'warning');
    }
197129
function (page) {
            var index = util.clamp(page - 1, 0, this.numPages),
                $precedingPage,
                $currentPage;

            paged.setCurrentPage.call(this, page);

            // update CSS classes
            this.$doc.find('.' + CSS_CLASS_PRECEDING_PAGE)
                .removeClass(CSS_CLASS_PRECEDING_PAGE);

            $precedingPage = this.$doc.find('.' + CSS_CLASS_CURRENT_PAGE);
            $currentPage = this.$pages.eq(index);

            if ($precedingPage[0] !== $currentPage[0]) {
                $precedingPage
                    .addClass(CSS_CLASS_PRECEDING_PAGE)
                    .removeClass(CSS_CLASS_CURRENT_PAGE);
                $currentPage.addClass(CSS_CLASS_CURRENT_PAGE);
            }

            this.updateVisiblePages(true);
            this.updatePageClasses(index);
        }
352895
function updateAttributes( element ) {
		var attrs = element.attributes,
			styles;

		// Will be recreated later if any of styles/classes exists.
		delete attrs.style;
		delete attrs[ 'class' ];

		if ( ( styles = CKEDITOR.tools.writeCssText( element.styles, true ) ) )
			attrs.style = styles;

		if ( element.classes.length )
			attrs[ 'class' ] = element.classes.sort().join( ' ' );
	}
789601
function updateScrollButtonVisibility(hideAll) {
		if (hideAll && this._topScrollButton && this._bottomScrollButton) {
			this._topScrollButton.style.display = "none";
			this._bottomScrollButton.style.display = "none";	
		}
		else if (!hideAll) {
			if (this._dropdownNode.scrollTop > 0) {
				this._topScrollButton.style.display = "block";
			} 
			else {
				this._topScrollButton.style.display = "none";
			}	
			if (this._dropdownNode.scrollHeight > this._dropdownNode.scrollTop + this._dropdownNode.offsetHeight) {
				this._bottomScrollButton.style.display = "block";
			}	 
			else {
				this._bottomScrollButton.style.display = "none";
			}
		}
	}
990685
function updateVisibility(tr, ids) {
  let display = 'none';
  ids.forEach(function(id) {
    if(id.includes(idFilter.value)) {
      display = '';
    }
  });
  tr.style.display = display;
}
346999
function update (src) {
      if (element.styleSheet) {
        element.styleSheet.cssText = src
      } else {
        element.textContent = src
      }
    }
575240
function updateAvailablePages(pages) {
        var i, page;
        for (i = 0; i < pages.length; ++i) {
            page = pages[i];
            viewerAPI.fire('realtimeupdate', { page: page });
            scope.broadcast('pageavailable', { page: page });
        }
    }
128076
function updateClassesWrite(treeNodes) {
	var node, j;
	for (var i = 0; i < treeNodes.length; i++) {
		node = treeNodes[i];
		for (j = 0; j < node._changes.length; j++) {
			(node._changes[j][0] ? addQuery : removeQuery)(node._element, node._changes[j][1]);
		}
		node._changes = [];
		updateClassesWrite(node._children);
	}
}
1031364
function updatePseudoClassStyle(styleId, properties, preventFocusStyleForTouchAndClick) {
  let focusStyle;
  if (preventFocusStyleForTouchAndClick) {
    focusStyle = { outline: 0 };
  } else {
    focusStyle = {
      ...style.focusStyle,
      ...properties.focusStyle,
    };
  }

  const styles = [
    {
      id: styleId,
      style: focusStyle,
      pseudoClass: 'focus',
    },
  ];

  injectStyles(styles);
}