-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2253 from vektor-inc/add/fixed-display/display-hi…
…de-timing [ 固定表示 ] タイマー機能追加
- Loading branch information
Showing
11 changed files
with
537 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; | ||
|
||
export default function save({ attributes }) { | ||
const { | ||
mode, | ||
position, | ||
scrollTiming, | ||
scrollTimingUnit, | ||
blockId, | ||
scrollPersistVisible, | ||
fixedPositionType, | ||
fixedPositionValue, | ||
fixedPositionUnit, | ||
} = attributes; | ||
|
||
const blockProps = useBlockProps.save({ | ||
className: `vk_fixed-display vk_fixed-display-mode-${mode} vk_fixed-display-position-${position} ${ | ||
['right', 'left'].includes(position) | ||
? `vk_fixed-display-position-from-${fixedPositionType}` | ||
: '' | ||
} vk_fixed-display-${blockId}`, | ||
style: { | ||
[fixedPositionType]: ['right', 'left'].includes(position) | ||
? `${fixedPositionValue}${fixedPositionUnit}` | ||
: undefined, | ||
}, | ||
...(mode === 'show-on-scroll' && { | ||
'data-scroll-timing': scrollTiming.toString(), | ||
'data-scroll-timing-unit': scrollTimingUnit, | ||
'data-persist-visible': scrollPersistVisible ? 'true' : 'false', | ||
}), | ||
}); | ||
|
||
return ( | ||
<div {...blockProps}> | ||
<InnerBlocks.Content /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.