[react_native] JS files from D2038965: Extract view specific commands from UIManager.

This commit is contained in:
Krzysztof Magiera 2015-05-05 02:51:17 -07:00
parent d713a711c4
commit 4402c4c885
2 changed files with 28 additions and 8 deletions

View File

@ -211,11 +211,19 @@ var ScrollView = React.createClass({
},
scrollTo: function(destY?: number, destX?: number) {
if (Platform.OS === 'android') {
RCTUIManager.dispatchViewManagerCommand(
this.getNodeHandle(),
RCTUIManager.RCTScrollView.Commands.scrollTo,
[destX || 0, destY || 0]
);
} else {
RCTUIManager.scrollTo(
this.getNodeHandle(),
destX || 0,
destY || 0
);
}
},
scrollWithoutAnimationTo: function(destY?: number, destX?: number) {

View File

@ -109,15 +109,27 @@ var WebView = React.createClass({
},
goForward: function() {
RCTUIManager.webViewGoForward(this.getWebWiewHandle());
RCTUIManager.dispatchViewManagerCommand(
this.getWebWiewHandle(),
RCTUIManager.RCTWebView.Commands.goForward,
null
);
},
goBack: function() {
RCTUIManager.webViewGoBack(this.getWebWiewHandle());
RCTUIManager.dispatchViewManagerCommand(
this.getWebWiewHandle(),
RCTUIManager.RCTWebView.Commands.goBack,
null
);
},
reload: function() {
RCTUIManager.webViewReload(this.getWebWiewHandle());
RCTUIManager.dispatchViewManagerCommand(
this.getWebWiewHandle(),
RCTUIManager.RCTWebView.Commands.reload,
null
);
},
/**