Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 4 additions & 29 deletions core/dropdowndiv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ export function createDom() {
// Transition animation for transform: translate() and opacity.
div.style.transition =
'transform ' + ANIMATION_TIME + 's, ' + 'opacity ' + ANIMATION_TIME + 's';

// Handle focusin/out events to add a visual indicator when
// a child is focused or blurred.
}

/**
Expand Down Expand Up @@ -166,8 +163,8 @@ export function getContentDiv(): HTMLDivElement {

/** Clear the content of the drop-down. */
export function clearContent() {
content.textContent = '';
content.style.width = '';
div.remove();
createDom();
}

/**
Expand Down Expand Up @@ -338,12 +335,8 @@ export function show<T>(
const mainWorkspace = common.getMainWorkspace() as WorkspaceSvg;
renderedClassName = mainWorkspace.getRenderer().getClassName();
themeClassName = mainWorkspace.getTheme().getClassName();
if (renderedClassName) {
dom.addClass(div, renderedClassName);
}
if (themeClassName) {
dom.addClass(div, themeClassName);
}
dom.addClass(div, renderedClassName);
dom.addClass(div, themeClassName);

// When we change `translate` multiple times in close succession,
// Chrome may choose to wait and apply them all at once.
Expand Down Expand Up @@ -645,31 +638,13 @@ export function hideWithoutAnimation() {
clearTimeout(animateOutTimer);
}

// Reset style properties in case this gets called directly
// instead of hide() - see discussion on #2551.
div.style.transform = '';
div.style.left = '';
div.style.top = '';
div.style.opacity = '0';
div.style.display = 'none';
div.style.backgroundColor = '';
div.style.borderColor = '';

if (onHide) {
onHide();
onHide = null;
}
clearContent();
owner = null;

if (renderedClassName) {
dom.removeClass(div, renderedClassName);
renderedClassName = '';
}
if (themeClassName) {
dom.removeClass(div, themeClassName);
themeClassName = '';
}
(common.getMainWorkspace() as WorkspaceSvg).markFocused();
}

Expand Down
Loading