File tree Expand file tree Collapse file tree 4 files changed +8
-36
lines changed
apps/app/gallery-app/content
tns-core-modules/ui/web-view Expand file tree Collapse file tree 4 files changed +8
-36
lines changed Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
22<Page >
3- <WebView margin =" 10" url =" http://www.telerik.com/nativescript" />
3+ <WebView margin =" 10" src =" http://www.telerik.com/nativescript" />
44</Page >
Original file line number Diff line number Diff line change @@ -21,15 +21,9 @@ export abstract class WebViewBase extends View implements WebViewDefinition {
2121 "other"
2222 ] ;
2323
24- public _suspendLoading : boolean ;
25-
2624 public src : string ;
2725
2826 public _onLoadFinished ( url : string , error ?: string ) {
29-
30- this . _suspendLoading = true ;
31- this . _suspendLoading = false ;
32-
3327 let args = < LoadEventData > {
3428 eventName : WebViewBase . loadFinishedEvent ,
3529 object : this ,
@@ -53,8 +47,6 @@ export abstract class WebViewBase extends View implements WebViewDefinition {
5347 this . notify ( args ) ;
5448 }
5549
56- abstract _loadUrl ( url : string ) : void ;
57-
5850 abstract _loadFileOrResource ( path : string , content : string ) : void ;
5951
6052 abstract _loadHttp ( src : string ) : void ;
@@ -81,10 +73,6 @@ export abstract class WebViewBase extends View implements WebViewDefinition {
8173 return "" ;
8274 }
8375 set [ srcProperty . native ] ( src : string ) {
84- if ( this . _suspendLoading ) {
85- return ;
86- }
87-
8876 this . stopLoading ( ) ;
8977
9078 if ( isFileOrResourcePath ( src ) ) {
@@ -103,6 +91,13 @@ export abstract class WebViewBase extends View implements WebViewDefinition {
10391 this . _loadData ( src ) ;
10492 }
10593 }
94+
95+ get url ( ) : string {
96+ throw new Error ( "Property url of WebView is deprecated. Use src istead" ) ;
97+ }
98+ set url ( value :string ) {
99+ throw new Error ( "Property url of WebView is deprecated. Use src istead" )
100+ }
106101}
107102
108103srcProperty . register ( WebViewBase ) ;
Original file line number Diff line number Diff line change @@ -112,18 +112,6 @@ export class WebView extends WebViewBase {
112112 super . _resetNativeView ( ) ;
113113 }
114114
115- public _loadUrl ( url : string ) {
116- if ( ! this . _android ) {
117- return ;
118- }
119-
120- if ( traceEnabled ( ) ) {
121- traceWrite ( "WebView._loadUrl(" + url + ")" , traceCategories . Debug ) ;
122- }
123- this . _android . stopLoading ( ) ;
124- this . _android . loadUrl ( url ) ;
125- }
126-
127115 public _loadFileOrResource ( path : string , content : string ) {
128116 if ( ! this . _android ) {
129117 return ;
Original file line number Diff line number Diff line change @@ -109,17 +109,6 @@ export class WebView extends WebViewBase {
109109 this . _ios . stopLoading ( ) ;
110110 }
111111
112- public _loadUrl ( url : string ) {
113- if ( traceEnabled ( ) ) {
114- traceWrite ( "WebView._loadUrl(" + url + ")" , traceCategories . Debug ) ;
115- }
116-
117- if ( this . _ios . loading ) {
118- this . _ios . stopLoading ( ) ;
119- }
120- this . _ios . loadRequest ( NSURLRequest . requestWithURL ( NSURL . URLWithString ( url ) ) ) ;
121- }
122-
123112 public _loadFileOrResource ( path : string , content : string ) {
124113 var baseURL = NSURL . fileURLWithPath ( NSString . stringWithString ( path ) . stringByDeletingLastPathComponent ) ;
125114 this . _ios . loadHTMLStringBaseURL ( content , baseURL ) ;
You can’t perform that action at this time.
0 commit comments