@samitouri / QOS-React-2 / commits / e65726cd04

Cleanup ReactEventEmitter Variable Naming

Minor follow-up to 80d7d2d0f8ec0f4f1f3c2dbe613f36bda572ce11.

Tim Yung committed Jan 6, 2014 at 09:43 UTC e65726cd04bf0b270641aab6f57c1192c9cd8a66
1 file changed +6 -6
src/core/ReactEventEmitter.js
+6 -6
@@ -124,7 +124,7 @@ var topEventMapping = {
124 */
125 var topListenersIDKey = "_reactListenersID" + String(Math.random()).slice(2);
126
127 -function getListeningDocument(mountAt) {
127 +function getListeningForDocument(mountAt) {
128 if (mountAt[topListenersIDKey] == null) {
129 mountAt[topListenersIDKey] = reactTopListenersCounter++;
130 alreadyListeningTo[mountAt[topListenersIDKey]] = {};
@@ -234,14 +234,14 @@ var ReactEventEmitter = merge(ReactEventEmitterMixin, {
234 */
235 listenTo: function(registrationName, contentDocument) {
236 var mountAt = contentDocument;
237 - var listeningDocument = getListeningDocument(mountAt);
237 + var isListening = getListeningForDocument(mountAt);
238 var dependencies = EventPluginRegistry.
239 registrationNameDependencies[registrationName];
240
241 var topLevelTypes = EventConstants.topLevelTypes;
242 for (var i = 0, l = dependencies.length; i < l; i++) {
243 var dependency = dependencies[i];
244 - if (!listeningDocument[dependency]) {
244 + if (!isListening[dependency]) {
245 var topLevelType = topLevelTypes[dependency];
246
247 if (topLevelType === topLevelTypes.topWheel) {
@@ -278,13 +278,13 @@ var ReactEventEmitter = merge(ReactEventEmitterMixin, {
278 }
279
280 // to make sure blur and focus event listeners are only attached once
281 - listeningDocument[topLevelTypes.topBlur] = true;
282 - listeningDocument[topLevelTypes.topFocus] = true;
281 + isListening[topLevelTypes.topBlur] = true;
282 + isListening[topLevelTypes.topFocus] = true;
283 } else {
284 trapBubbledEvent(topLevelType, topEventMapping[dependency], mountAt);
285 }
286
287 - listeningDocument[dependency] = true;
287 + isListening[dependency] = true;
288 }
289 }
290 },