2015-02-19 20:10:52 -08:00
|
|
|
/**
|
|
|
|
* @providesModule ReactIOSGlobalResponderHandler
|
|
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
|
2015-03-17 22:22:03 -07:00
|
|
|
var RCTUIManager = require('NativeModules').UIManager;
|
2015-02-19 20:10:52 -08:00
|
|
|
var ReactIOSTagHandles = require('ReactIOSTagHandles');
|
|
|
|
|
|
|
|
var ReactIOSGlobalResponderHandler = {
|
|
|
|
onChange: function(from, to) {
|
|
|
|
if (to !== null) {
|
2015-03-17 03:08:46 -07:00
|
|
|
RCTUIManager.setJSResponder(
|
2015-02-19 20:10:52 -08:00
|
|
|
ReactIOSTagHandles.mostRecentMountedNodeHandleForRootNodeID(to)
|
|
|
|
);
|
|
|
|
} else {
|
2015-03-17 03:08:46 -07:00
|
|
|
RCTUIManager.clearJSResponder();
|
2015-02-19 20:10:52 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = ReactIOSGlobalResponderHandler;
|