aboutsummaryrefslogtreecommitdiff
path: root/src/content/actions/operation.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-05-11 11:51:29 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2019-05-11 11:51:29 +0900
commitad1f3c07fbb90c4e69cc2374d74a7373e4da70f2 (patch)
treeae73b962860b334a760137a557dfa9b3c0cd285c /src/content/actions/operation.ts
parent1ba1660269b24446e9df7df0016de8c3e5596c8f (diff)
Make scroller as a presenter
Diffstat (limited to 'src/content/actions/operation.ts')
-rw-r--r--src/content/actions/operation.ts17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/content/actions/operation.ts b/src/content/actions/operation.ts
index f65d0bd..b264e36 100644
--- a/src/content/actions/operation.ts
+++ b/src/content/actions/operation.ts
@@ -1,7 +1,6 @@
import * as operations from '../../shared/operations';
import * as actions from './index';
import * as messages from '../../shared/messages';
-import * as scrolls from '../scrolls';
import * as navigates from '../navigates';
import * as focuses from '../focuses';
import * as urls from '../urls';
@@ -10,9 +9,11 @@ import * as markActions from './mark';
import AddonEnabledUseCase from '../usecases/AddonEnabledUseCase';
import { SettingRepositoryImpl } from '../repositories/SettingRepository';
+import { ScrollPresenterImpl } from '../presenters/ScrollPresenter';
let addonEnabledUseCase = new AddonEnabledUseCase();
let settingRepository = new SettingRepositoryImpl();
+let scrollPresenter = new ScrollPresenterImpl();
// eslint-disable-next-line complexity, max-lines-per-function
const exec = async(
@@ -41,25 +42,25 @@ const exec = async(
}), '*');
break;
case operations.SCROLL_VERTICALLY:
- scrolls.scrollVertically(operation.count, smoothscroll);
+ scrollPresenter.scrollVertically(operation.count, smoothscroll);
break;
case operations.SCROLL_HORIZONALLY:
- scrolls.scrollHorizonally(operation.count, smoothscroll);
+ scrollPresenter.scrollHorizonally(operation.count, smoothscroll);
break;
case operations.SCROLL_PAGES:
- scrolls.scrollPages(operation.count, smoothscroll);
+ scrollPresenter.scrollPages(operation.count, smoothscroll);
break;
case operations.SCROLL_TOP:
- scrolls.scrollToTop(smoothscroll);
+ scrollPresenter.scrollToTop(smoothscroll);
break;
case operations.SCROLL_BOTTOM:
- scrolls.scrollToBottom(smoothscroll);
+ scrollPresenter.scrollToBottom(smoothscroll);
break;
case operations.SCROLL_HOME:
- scrolls.scrollToHome(smoothscroll);
+ scrollPresenter.scrollToHome(smoothscroll);
break;
case operations.SCROLL_END:
- scrolls.scrollToEnd(smoothscroll);
+ scrollPresenter.scrollToEnd(smoothscroll);
break;
case operations.FOLLOW_START:
window.top.postMessage(JSON.stringify({