feat(web-view): disableZoom property (#9391)

This commit is contained in:
Osei Fortune
2021-05-12 12:00:51 -04:00
committed by GitHub
parent 64adf5ecfc
commit 7e878f83a3
3 changed files with 82 additions and 2 deletions

View File

@@ -3,11 +3,14 @@ import { ContainerView, CSSType } from '../core/view';
import { Property } from '../core/properties';
import { EventData } from '../../data/observable';
import { knownFolders } from '../../file-system';
import { booleanConverter } from '../core/view-base';
export * from './web-view-interfaces';
export const srcProperty = new Property<WebViewBase, string>({ name: 'src' });
export const disableZoomProperty = new Property<WebViewBase, boolean>({ name: 'disableZoom', defaultValue: false, valueConverter: booleanConverter });
@CSSType('WebView')
export abstract class WebViewBase extends ContainerView {
public static loadStartedEvent = 'loadStarted';
@@ -15,6 +18,8 @@ export abstract class WebViewBase extends ContainerView {
public src: string;
public disableZoom: boolean;
public _onLoadFinished(url: string, error?: string) {
const args = <LoadEventData>{
eventName: WebViewBase.loadFinishedEvent,
@@ -102,3 +107,4 @@ export interface WebViewBase {
}
srcProperty.register(WebViewBase);
disableZoomProperty.register(WebViewBase);