aboutsummaryrefslogtreecommitdiff
path: root/src/content
diff options
context:
space:
mode:
Diffstat (limited to 'src/content')
-rw-r--r--src/content/Application.ts2
-rw-r--r--src/content/controllers/ConsoleFrameController.ts4
-rw-r--r--src/content/presenters/ConsoleFramePresenter.ts10
-rw-r--r--src/content/site-style.ts1
-rw-r--r--src/content/usecases/ConsoleFrameUseCase.ts4
5 files changed, 20 insertions, 1 deletions
diff --git a/src/content/Application.ts b/src/content/Application.ts
index 996bbbc..7c8e588 100644
--- a/src/content/Application.ts
+++ b/src/content/Application.ts
@@ -107,6 +107,8 @@ export default class Application {
return this.navigateController.openLinkNext(msg);
case messages.NAVIGATE_LINK_PREV:
return this.navigateController.openLinkPrev(msg);
+ case messages.CONSOLE_RESIZE:
+ return this.consoleFrameController.resize(msg);
}
});
diff --git a/src/content/controllers/ConsoleFrameController.ts b/src/content/controllers/ConsoleFrameController.ts
index 84e0ce6..38d3409 100644
--- a/src/content/controllers/ConsoleFrameController.ts
+++ b/src/content/controllers/ConsoleFrameController.ts
@@ -9,4 +9,8 @@ export default class ConsoleFrameController {
unfocus(_message: messages.Message) {
this.consoleFrameUseCase.unfocus();
}
+
+ resize(message: messages.ConsoleResizeMessage) {
+ this.consoleFrameUseCase.resize(message.width, message.height);
+ }
}
diff --git a/src/content/presenters/ConsoleFramePresenter.ts b/src/content/presenters/ConsoleFramePresenter.ts
index 26522c4..ccc196b 100644
--- a/src/content/presenters/ConsoleFramePresenter.ts
+++ b/src/content/presenters/ConsoleFramePresenter.ts
@@ -2,6 +2,8 @@ export default interface ConsoleFramePresenter {
initialize(): void;
blur(): void;
+
+ resize(width: number, height: number): void;
}
export class ConsoleFramePresenterImpl implements ConsoleFramePresenter {
@@ -20,4 +22,12 @@ export class ConsoleFramePresenterImpl implements ConsoleFramePresenter {
}
ele.blur();
}
+
+ resize(_width: number, height: number): void {
+ const ele = document.getElementById("vimvixen-console-frame");
+ if (!ele) {
+ return;
+ }
+ ele.style.height = `${height}px`;
+ }
}
diff --git a/src/content/site-style.ts b/src/content/site-style.ts
index 3748c6b..478de10 100644
--- a/src/content/site-style.ts
+++ b/src/content/site-style.ts
@@ -5,7 +5,6 @@ export default `
bottom: 0;
left: 0;
width: 100%;
- height: 100%;
position: fixed;
z-index: 2147483647;
border: none !important;
diff --git a/src/content/usecases/ConsoleFrameUseCase.ts b/src/content/usecases/ConsoleFrameUseCase.ts
index b118c7f..7a0891d 100644
--- a/src/content/usecases/ConsoleFrameUseCase.ts
+++ b/src/content/usecases/ConsoleFrameUseCase.ts
@@ -12,4 +12,8 @@ export default class ConsoleFrameUseCase {
window.focus();
this.consoleFramePresenter.blur();
}
+
+ resize(width: number, height: number) {
+ this.consoleFramePresenter.resize(width, height);
+ }
}