Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
v8tenko committed Aug 29, 2024
1 parent 0d436c4 commit 6b7a456
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/plugin/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type MarkdownIt from 'markdown-it';
import type Core from 'markdown-it/lib/parser_core';
import {AttrsParser} from '@diplodoc/utils'
import {AttrsParser} from '@diplodoc/utils';

import {ClassNames, ENV_FLAG_NAME, TokenType} from './const';
import {findCloseTokenIdx, matchOpenToken} from './helpers';
Expand Down
10 changes: 5 additions & 5 deletions src/runtime/contoller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@ export class YfmCutController {
_focusActiveCut() {
const cutId = window.location.hash.slice(1);
const cutNode = document.getElementById(cutId) as HTMLDetailsElement | null;

if (!(cutNode instanceof HTMLElement)) {
return;
}

if (!cutNode.matches(Selector.CUT)) {
return;
}

cutNode.classList.toggle(ClassName.OPEN);
cutNode.setAttribute('open', 'true');

setTimeout(() => {
cutNode.classList.add('cut-highlight');
cutNode.scrollIntoView();
}, 70)
}, 70);

setTimeout(() => {
cutNode.classList.remove('cut-highlight');
}, 1_000)
}, 1_000);
}

private _onDocClick = (event: MouseEvent) => {
Expand Down

0 comments on commit 6b7a456

Please sign in to comment.