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
31 changes: 0 additions & 31 deletions core/utils/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,37 +181,6 @@ export function getViewportPageOffset(): Coordinate {
return new Coordinate(scrollLeft, scrollTop);
}

/**
* Shows or hides an element from the page. Hiding the element is done by
* setting the display property to "none", removing the element from the
* rendering hierarchy so it takes up no space. To show the element, the default
* inherited display property is restored (defined either in stylesheets or by
* the browser's default style rules).
* Copied from Closure's goog.style.getViewportPageOffset
*
* @param el Element to show or hide.
* @param isShown True to render the element in its default style, false to
* disable rendering the element.
* @alias Blockly.utils.style.setElementShown
*/
export function setElementShown(el: Element, isShown: AnyDuringMigration) {
// AnyDuringMigration because: Property 'style' does not exist on type
// 'Element'.
(el as AnyDuringMigration).style.display = isShown ? '' : 'none';
}

/**
* Returns true if the element is using right to left (RTL) direction.
* Copied from Closure's goog.style.isRightToLeft
*
* @param el The element to test.
* @returns True for right to left, false for left to right.
* @alias Blockly.utils.style.isRightToLeft
*/
export function isRightToLeft(el: Element): boolean {
return 'rtl' === getStyle(el, 'direction');
}

/**
* Gets the computed border widths (on all sides) in pixels
* Copied from Closure's goog.style.getBorderBox
Expand Down