aboutsummaryrefslogtreecommitdiff
path: root/src/content/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/components')
-rw-r--r--src/content/components/common/mark.ts9
-rw-r--r--src/content/components/top-content/index.ts5
2 files changed, 8 insertions, 6 deletions
diff --git a/src/content/components/common/mark.ts b/src/content/components/common/mark.ts
index 77aa15d..ddd1a38 100644
--- a/src/content/components/common/mark.ts
+++ b/src/content/components/common/mark.ts
@@ -1,12 +1,13 @@
import * as markActions from '../../actions/mark';
-import * as scrolls from '../..//scrolls';
import * as consoleFrames from '../..//console-frames';
import * as keyUtils from '../../../shared/utils/keys';
import Mark from '../../Mark';
import { SettingRepositoryImpl } from '../../repositories/SettingRepository';
+import { ScrollPresenterImpl } from '../../presenters/ScrollPresenter';
let settingRepository = new SettingRepositoryImpl();
+let scrollPresenter = new ScrollPresenterImpl();
const cancelKey = (key: keyUtils.Key): boolean => {
return key.key === 'Esc' || key.key === '[' && Boolean(key.ctrlKey);
@@ -54,7 +55,7 @@ export default class MarkComponent {
}
doSet(key: keyUtils.Key) {
- let { x, y } = scrolls.getScroll();
+ let { x, y } = scrollPresenter.getScroll();
this.store.dispatch(markActions.setLocal(key.key, x, y));
}
@@ -69,11 +70,11 @@ export default class MarkComponent {
}
let { x, y } = marks[key.key];
- scrolls.scrollTo(x, y, smoothscroll);
+ scrollPresenter.scrollTo(x, y, smoothscroll);
}
doSetGlobal(key: keyUtils.Key) {
- let { x, y } = scrolls.getScroll();
+ let { x, y } = scrollPresenter.getScroll();
this.store.dispatch(markActions.setGlobal(key.key, x, y));
}
diff --git a/src/content/components/top-content/index.ts b/src/content/components/top-content/index.ts
index b9ef2dd..de14b3f 100644
--- a/src/content/components/top-content/index.ts
+++ b/src/content/components/top-content/index.ts
@@ -4,10 +4,11 @@ import FindComponent from './find';
import * as consoleFrames from '../../console-frames';
import * as messages from '../../../shared/messages';
import MessageListener from '../../MessageListener';
-import * as scrolls from '../../scrolls';
import AddonEnabledUseCase from '../../usecases/AddonEnabledUseCase';
+import { ScrollPresenterImpl } from '../../presenters/ScrollPresenter';
let addonEnabledUseCase = new AddonEnabledUseCase();
+let scrollPresenter = new ScrollPresenterImpl();
export default class TopContent {
private win: Window;
@@ -42,7 +43,7 @@ export default class TopContent {
case messages.ADDON_ENABLED_QUERY:
return Promise.resolve(addonEnabled);
case messages.TAB_SCROLL_TO:
- return scrolls.scrollTo(message.x, message.y, false);
+ return scrollPresenter.scrollTo(message.x, message.y, false);
}
}
}