From 7f2cdefd1dbdb6dcab3fb41cade558bd52e528b3 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 14 Feb 2018 23:19:15 -0800 Subject: [PATCH] Cleanup webview findwidget --- .../parts/html/browser/webviewFindWidget.ts | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/vs/workbench/parts/html/browser/webviewFindWidget.ts b/src/vs/workbench/parts/html/browser/webviewFindWidget.ts index cd8f76cfb39..f304d2f56eb 100644 --- a/src/vs/workbench/parts/html/browser/webviewFindWidget.ts +++ b/src/vs/workbench/parts/html/browser/webviewFindWidget.ts @@ -10,19 +10,15 @@ import { Webview } from './webview'; export class WebviewFindWidget extends SimpleFindWidget { constructor( - @IContextViewService _contextViewService: IContextViewService, - private webview: Webview + @IContextViewService contextViewService: IContextViewService, + private readonly webview: Webview ) { - super(_contextViewService); - - this.find = this.find.bind(this); - this.hide = this.hide.bind(this); - this.onInputChanged = this.onInputChanged.bind(this); + super(contextViewService); } public find(previous: boolean) { - let val = this.inputValue; - if (this.webview !== null && val) { + const val = this.inputValue; + if (val) { this.webview.find(val, { findNext: true, forward: !previous }); } } @@ -34,11 +30,7 @@ export class WebviewFindWidget extends SimpleFindWidget { } public onInputChanged() { - if (!this.webview) { - return; - } - - let val = this.inputValue; + const val = this.inputValue; if (val) { this.webview.startFind(val); } else {