Scrolling to current chapter in mobile TOC

オープン 初心者向け
#374 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Abhirup-99 がすでに取り組んでいます。

2020年9月22日 から。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
62/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
javascript
領域
frontend, mobile

調査の方向性

モバイル目次を開いたときに実行される src/js/plugins/plugin.chapters.js の BookReader.prototype.updateTOCState から始めます。既存の .current-chapter 要素を使用し、スクロール方法を選ぶ前に TOC と mmenu の動作を確認してください。モバイル目次を再度開いたときに、予期しない mmenu の動作なしでリストが現在の章の位置に移動すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Context
We would like the list of the chapters to be scrolled to the current chapter each time the table of contents is opened

Proposal & Constraints

The process to find the current chapter when the TOC table is opened is already done. The current chapter element is defined by the class .current-chapter. The code to scroll the TOC table to the current chapter should be in the BookReader.prototype.updateTOCState function inside src/js/plugins/plugin.chapters.js, because it gets called each time the mobile TOC table is opened.
Using something like .ScrollIntoView() may not work every time because of conflicts with mmenu. Simpler scrolling methods may cause less unexpected problem.

主要言語
JavaScript
スター
1.2k
フォーク
498
平均マージ
1時間
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

internetarchive/bookreader のほかの issue

internetarchive/bookreader の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。