[react_native] JS files from D2017699: Expose JavaScriptEnabled property for WebView component on android.

This commit is contained in:
Krzysztof Magiera 2015-04-24 11:58:31 -07:00
Родитель 1f98c843b0
Коммит 46db1826c5
3 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -94,6 +94,7 @@ var WebViewExample = React.createClass({
automaticallyAdjustContentInsets={false}
style={styles.webView}
url={this.state.url}
javaScriptEnabledAndroid={true}
onNavigationStateChange={this.onNavigationStateChange}
startInLoadingState={true}
/>

Просмотреть файл

@ -42,6 +42,7 @@ var WebView = React.createClass({
onNavigationStateChange: PropTypes.func,
startInLoadingState: PropTypes.bool, // force WebView to show loadingView on first load
style: View.propTypes.style,
javaScriptEnabledAndroid: PropTypes.bool,
/**
* Used to locate this view in end-to-end tests.
*/
@ -90,6 +91,7 @@ var WebView = React.createClass({
key="webViewKey"
style={webViewStyles}
url={this.props.url}
javaScriptEnabledAndroid={this.props.javaScriptEnabledAndroid}
contentInset={this.props.contentInset}
automaticallyAdjustContentInsets={this.props.automaticallyAdjustContentInsets}
onLoadingStart={this.onLoadingStart}
@ -157,6 +159,7 @@ var WebView = React.createClass({
var RCTWebView = createReactIOSNativeComponentClass({
validAttributes: merge(ReactIOSViewAttributes.UIView, {
url: true,
javaScriptEnabledAndroid: true,
}),
uiViewClassName: 'RCTWebView',
});

Просмотреть файл

@ -92,6 +92,10 @@ var WebView = React.createClass({
onNavigationStateChange: PropTypes.func,
startInLoadingState: PropTypes.bool, // force WebView to show loadingView on first load
style: View.propTypes.style,
/**
* Used for android only, JS is enabled by default for WebView on iOS
*/
javaScriptEnabledAndroid: PropTypes.bool,
},
getInitialState: function() {