mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
move the typescript code snippet to external file
This commit is contained in:
30
tests/app/ui/web-view/web-view-code-snippet.ts
Normal file
30
tests/app/ui/web-view/web-view-code-snippet.ts
Normal file
@ -0,0 +1,30 @@
|
||||
// >> web-view-loaded
|
||||
import { EventData } from 'data/observable';
|
||||
import { Page } from 'ui/page';
|
||||
import { HelloWorldModel } from './main-view-model';
|
||||
import { WebView } from "ui/web-view";
|
||||
import { isAndroid } from "platform"
|
||||
|
||||
|
||||
export function navigatingTo(args: EventData) {
|
||||
|
||||
let page = <Page>args.object;
|
||||
|
||||
page.bindingContext = new HelloWorldModel();
|
||||
}
|
||||
|
||||
export function webViewTouch(args){
|
||||
console.log("touch event");
|
||||
}
|
||||
|
||||
export function webViewPan(args){
|
||||
console.log("pan gesture");
|
||||
}
|
||||
|
||||
export function webViewLoaded(args){
|
||||
var webview:WebView = <WebView>args.object;
|
||||
if(isAndroid){
|
||||
webview.android.getSettings().setDisplayZoomControls(false);
|
||||
}
|
||||
}
|
||||
// >> web-view-loaded
|
Reference in New Issue
Block a user