table/utils/resize
Constants
module:table/utils/resize~RESIZE_DISTANCE_THRESHOLDThe distance in pixels that the mouse has to move to start resizing a column or a row.
module:table/utils/resize~RESIZE_PRECISIONDetermines how many digits after the decimal point are used to store the column widths and the row heights.
Functions
fitResizerToTable( view, viewResizer, type ) → voidinternalmodule:table/utils/resize~fitResizerToTableSets the side styles of a column or a row resizer handle, so it stretches over the whole height or width of the table.
Parameters
view: EditingViewThe editing view.
viewResizer: ViewElementThe resizer handle element.
type: 'row' | 'column'Whether it is a column or a row resizer.
Returns
void
registerResizerInserter( editor, className ) → voidinternalmodule:table/utils/resize~registerResizerInserterRegisters a listener ensuring that each table cell has a column or a row resizer handle.
Parameters
editor: EditorThe editor instance.
className: stringThe class of the resizer handle element.
Returns
void
resetResizerStyles( view, viewResizer, type ) → voidinternalmodule:table/utils/resize~resetResizerStylesRemoves the side styles set by
fitResizerToTable().Parameters
view: EditingViewThe editing view.
viewResizer: ViewElementThe resizer handle element.
type: 'row' | 'column'Whether it is a column or a row resizer.
Returns
void
toPrecision( value ) → numberinternalmodule:table/utils/resize~toPrecisionRounds the provided value to a fixed-point number with defined number of digits after the decimal point.
Parameters
value: string | numberA number to be rounded.
Returns
numberThe rounded number.
toggleResizingCursor( className, cursor, isActive ) → voidinternalmodule:table/utils/resize~toggleResizingCursorShows the resizing cursor everywhere while a column or a row is resized, also when the editor is in a shadow root.
The class goes to the
<body>and is styled by a rule adopted into the document, as a theme stylesheet loaded into a shadow root cannot style the<body>. The cursor of the shadow host is inherited by the editor content inside.Parameters
className: stringThe class that sets the cursor.
cursor: stringThe cursor to show.
isActive: booleanWhether the resizing is in progress.
Returns
void
toggleResizingDisabledClass( view, className, isResizingAllowed ) → voidinternalmodule:table/utils/resize~toggleResizingDisabledClassToggles the class that hides the column or the row resizer handles (through CSS) on all editing roots.
Parameters
view: EditingViewThe editing view.
className: stringThe class that hides the resizer handles.
isResizingAllowed: booleanWhether the resizing is allowed. The class is added when it is not.
Returns
void