Merge pull request #54 from wJianZhong/master
Add props onLoad and onLoadEnd
This commit is contained in:
commit
6ef4ec1585
|
@ -14,7 +14,9 @@ var Canvas = createReactClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
style: PropTypes.object,
|
style: PropTypes.object,
|
||||||
context: PropTypes.object,
|
context: PropTypes.object,
|
||||||
render: PropTypes.func.isRequired
|
render: PropTypes.func.isRequired,
|
||||||
|
onLoad: PropTypes.func,
|
||||||
|
onLoadEnd: PropTypes.func,
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
@ -32,6 +34,8 @@ var Canvas = createReactClass({
|
||||||
style={this.props.style}
|
style={this.props.style}
|
||||||
javaScriptEnabled={true}
|
javaScriptEnabled={true}
|
||||||
scrollEnabled={false}
|
scrollEnabled={false}
|
||||||
|
onLoad={this.props.onLoad}
|
||||||
|
onLoadEnd={this.props.onLoadEnd}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|
|
@ -53,6 +53,8 @@ var QRCode = createReactClass({
|
||||||
size: PropTypes.number,
|
size: PropTypes.number,
|
||||||
bgColor: PropTypes.string,
|
bgColor: PropTypes.string,
|
||||||
fgColor: PropTypes.string,
|
fgColor: PropTypes.string,
|
||||||
|
onLoad: PropTypes.func,
|
||||||
|
onLoadEnd: PropTypes.func,
|
||||||
},
|
},
|
||||||
|
|
||||||
getDefaultProps: function() {
|
getDefaultProps: function() {
|
||||||
|
@ -61,6 +63,8 @@ var QRCode = createReactClass({
|
||||||
fgColor: 'white',
|
fgColor: 'white',
|
||||||
bgColor: 'black',
|
bgColor: 'black',
|
||||||
size: 128,
|
size: 128,
|
||||||
|
onLoad: () => {},
|
||||||
|
onLoadEnd: () => {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -98,6 +102,8 @@ var QRCode = createReactClass({
|
||||||
cells: qr(value).modules,
|
cells: qr(value).modules,
|
||||||
}}
|
}}
|
||||||
render={renderCanvas}
|
render={renderCanvas}
|
||||||
|
onLoad={this.props.onLoad}
|
||||||
|
onLoadEnd={this.props.onLoadEnd}
|
||||||
style={{height: size, width: size}}
|
style={{height: size, width: size}}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
Loading…
Reference in New Issue