Skip to content

Commit

Permalink
9.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
green1052 committed Dec 19, 2021
1 parent 4466c1b commit 4ca501d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "betternovelpia",
"version": "9.0.4",
"version": "9.0.5",
"license": "UNLICENSED",
"scripts": {
"build": "webpack",
Expand Down
2 changes: 1 addition & 1 deletion src/module/Setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function Setting() {
transform: "translate(-50%, -50%)",
zIndex: 999999
}}>
<input onChange={(e) => setData(e.target.value)}
<input autoFocus onChange={(e) => setData(e.target.value)}
value={data}
type="text"
placeholder="데이터를 입력해주세요"/>
Expand Down
24 changes: 17 additions & 7 deletions src/module/bookmark/Bookmark.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback, useEffect, useState} from "react";
import React, {useCallback, useEffect, useRef, useState} from "react";
import ReactDOM from "react-dom";
import styled, {createGlobalStyle, css} from "styled-components";
import {EP_List, NOVEL_BOX, NOVEL_DRAWING, NOVEL_EP, NOVEL_TITLE} from "../../util/Selectors";
Expand All @@ -17,13 +17,23 @@ function Bookmark() {
const [hide, setHide] = useState(true);
const [inputHide, setInputHide] = useState(true);
const [data, setData] = useState("");
const [scrollTop, setScrollTop] = useState(0);

useEffect(() =>
appendSide($(`<li style="padding: 10px 25px;"><span style="width:20px;display: inline-block;text-align:center;"><i class="icon ion-bookmark"></i></span> 북마크</li>`)
.on("click", () => setHide(false)))
, []);
const bookmarkList = useRef<HTMLOListElement>(null);

useEffect(() => {
if (scrollTop !== 0)
bookmarkList.current?.scroll(0, scrollTop);
}, [scrollTop]);

useEffect(() => {
appendSide($(`<li style="padding: 10px 25px;"><span style="width:20px;display: inline-block;text-align:center;"><i class="icon ion-bookmark"></i></span> 북마크</li>`)
.on("click", () => setHide(false)));
}, []);

const deleteBookmark = useCallback((url: string) => {
setScrollTop(bookmarkList.current?.scrollTop ?? 0);

const bookmarks1 = {...bookmarks};
delete bookmarks1[url];
setBookmarks(bookmarks1);
Expand Down Expand Up @@ -113,7 +123,7 @@ function Bookmark() {
top: "50%",
transform: "translate(-50%, -50%)"
}}>
<input onChange={(e) => setData(e.target.value)}
<input autoFocus onChange={(e) => setData(e.target.value)}
value={data}
type="text"
placeholder="데이터를 입력해주세요"/>
Expand All @@ -124,7 +134,7 @@ function Bookmark() {

<h2 style={{marginTop: "5px", textAlign: "center"}}>북마크 관리</h2>

<ol className="no-overflow bookmark"
<ol ref={bookmarkList} className="no-overflow bookmark"
style={{
height: "85vh",
overflow: "auto",
Expand Down

0 comments on commit 4ca501d

Please sign in to comment.