mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 19:36:12 +01:00
feat(split): add right to left support
See https://github.com/nathancahill/split/issues/739
This commit is contained in:
3
packages/splitjs/index.d.ts
vendored
3
packages/splitjs/index.d.ts
vendored
@@ -44,6 +44,9 @@ declare namespace Split {
|
|||||||
// Direction to split: horizontal or vertical.
|
// Direction to split: horizontal or vertical.
|
||||||
direction?: 'horizontal' | 'vertical'
|
direction?: 'horizontal' | 'vertical'
|
||||||
|
|
||||||
|
// If the UI is right-to-left. Affects the drag direction.
|
||||||
|
rtl?: boolean
|
||||||
|
|
||||||
// Cursor to display while dragging.
|
// Cursor to display while dragging.
|
||||||
cursor?: string
|
cursor?: string
|
||||||
|
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ const Split = (idsOption, options = {}) => {
|
|||||||
defaultElementStyleFn,
|
defaultElementStyleFn,
|
||||||
)
|
)
|
||||||
const gutterStyle = getOption(options, 'gutterStyle', defaultGutterStyleFn)
|
const gutterStyle = getOption(options, 'gutterStyle', defaultGutterStyleFn)
|
||||||
|
const rtl = getOption(options, 'rtl', false)
|
||||||
|
|
||||||
// 2. Initialize a bunch of strings based on the direction we're splitting.
|
// 2. Initialize a bunch of strings based on the direction we're splitting.
|
||||||
// A lot of the behavior in the rest of the library is paramatized down to
|
// A lot of the behavior in the rest of the library is paramatized down to
|
||||||
@@ -621,6 +622,7 @@ const Split = (idsOption, options = {}) => {
|
|||||||
|
|
||||||
// if the parent has a reverse flex-direction, switch the pair elements.
|
// if the parent has a reverse flex-direction, switch the pair elements.
|
||||||
if (
|
if (
|
||||||
|
(direction === HORIZONTAL && rtl) ||
|
||||||
parentFlexDirection === 'row-reverse' ||
|
parentFlexDirection === 'row-reverse' ||
|
||||||
parentFlexDirection === 'column-reverse'
|
parentFlexDirection === 'column-reverse'
|
||||||
) {
|
) {
|
||||||
|
|||||||
Reference in New Issue
Block a user