File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 33/// <reference lib="dom" />
44
55import { encodeTitleURI } from "../../title.ts" ;
6+ import {
7+ PageTransitionContext ,
8+ pushPageTransition ,
9+ } from "./pushPageTransition.ts" ;
610import type { Scrapbox } from "../../deps/scrapbox.ts" ;
711declare const scrapbox : Scrapbox ;
812
@@ -24,6 +28,9 @@ export interface OpenOptions {
2428 * @default 同じprojectの場合は再読み込みせず、違うprojectの場合は再読込する
2529 */
2630 reload ?: boolean ;
31+
32+ /** リンク先へスクロールする機能を使うために必要な情報 */
33+ context ?: Omit < PageTransitionContext , "to" > ;
2734}
2835
2936/** ページを開く
@@ -41,6 +48,12 @@ export const open = (
4148 if ( options ?. body ) url . search = `?body=${ encodeURIComponent ( options . body ) } ` ;
4249 if ( options ?. id ) url . hash = `#${ options . id } ` ;
4350
51+ if ( options ?. context ) {
52+ pushPageTransition (
53+ { ...options ?. context , to : { project, title } } as PageTransitionContext ,
54+ ) ;
55+ }
56+
4457 if (
4558 options ?. newTab !== false &&
4659 ( options ?. newTab === true || project !== scrapbox . Project . name )
You can’t perform that action at this time.
0 commit comments