diff options
Diffstat (limited to 'src/content/operators/impls/ScrollToTopOperator.ts')
-rw-r--r-- | src/content/operators/impls/ScrollToTopOperator.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/content/operators/impls/ScrollToTopOperator.ts b/src/content/operators/impls/ScrollToTopOperator.ts new file mode 100644 index 0000000..6075758 --- /dev/null +++ b/src/content/operators/impls/ScrollToTopOperator.ts @@ -0,0 +1,20 @@ +import AbstractScrollOperator from "./AbstractScrollOperator"; +import Operator from "../Operator"; +import ScrollPresenter from "../../presenters/ScrollPresenter"; +import SettingRepository from "../../repositories/SettingRepository"; + +export default class ScrollToTopOperator + extends AbstractScrollOperator + implements Operator { + constructor( + private readonly presenter: ScrollPresenter, + settingRepository: SettingRepository + ) { + super(settingRepository); + } + + async run(): Promise<void> { + const smooth = this.getSmoothScroll(); + this.presenter.scrollToTop(smooth); + } +} |