Browse Source

adapt old iOS api - temporarily

Daniel Zlotin 8 years ago
parent
commit
69bedf8cbd
1 changed files with 53 additions and 12 deletions
  1. 53
    12
      src/deprecated/platformSpecificDeprecated.ios.js

+ 53
- 12
src/deprecated/platformSpecificDeprecated.ios.js View File

216
   passProps.screenInstanceID = screenInstanceID;
216
   passProps.screenInstanceID = screenInstanceID;
217
   passProps.navigatorEventID = navigatorEventID;
217
   passProps.navigatorEventID = navigatorEventID;
218
 
218
 
219
+  params.navigationParams = {
220
+    screenInstanceID,
221
+    navigatorStyle,
222
+    navigatorButtons,
223
+    navigatorEventID,
224
+    navigatorID: navigator.navigatorID
225
+  };
226
+
219
   savePassProps(params);
227
   savePassProps(params);
220
 
228
 
221
   Controllers.NavigationControllerIOS(navigator.navigatorID).push({
229
   Controllers.NavigationControllerIOS(navigator.navigatorID).push({
260
   passProps.screenInstanceID = screenInstanceID;
268
   passProps.screenInstanceID = screenInstanceID;
261
   passProps.navigatorEventID = navigatorEventID;
269
   passProps.navigatorEventID = navigatorEventID;
262
 
270
 
271
+  params.navigationParams = {
272
+    screenInstanceID,
273
+    navigatorStyle,
274
+    navigatorButtons,
275
+    navigatorEventID,
276
+    navigatorID: navigator.navigatorID
277
+  };
278
+
263
   savePassProps(params);
279
   savePassProps(params);
264
 
280
 
265
   Controllers.NavigationControllerIOS(navigator.navigatorID).resetTo({
281
   Controllers.NavigationControllerIOS(navigator.navigatorID).resetTo({
374
     return;
390
     return;
375
   }
391
   }
376
   const controllerID = _.uniqueId('controllerID');
392
   const controllerID = _.uniqueId('controllerID');
393
+  const navigatorID = controllerID + '_nav';
394
+  const screenInstanceID = _.uniqueId('screenInstanceID');
395
+  const {
396
+    navigatorStyle,
397
+    navigatorButtons,
398
+    navigatorEventID
399
+  } = _mergeScreenSpecificSettings(params.screen, screenInstanceID, params);
400
+  const passProps = Object.assign({}, params.passProps);
401
+  passProps.navigatorID = navigatorID;
402
+  passProps.screenInstanceID = screenInstanceID;
403
+  passProps.navigatorEventID = navigatorEventID;
404
+
405
+  params.navigationParams = {
406
+    screenInstanceID,
407
+    navigatorStyle,
408
+    navigatorButtons,
409
+    navigatorEventID,
410
+    navigatorID: navigator.navigatorID
411
+  };
412
+
377
   const Controller = Controllers.createClass({
413
   const Controller = Controllers.createClass({
378
     render: function() {
414
     render: function() {
379
-      const navigatorID = controllerID + '_nav';
380
-      const screenInstanceID = _.uniqueId('screenInstanceID');
381
-      const {
382
-        navigatorStyle,
383
-        navigatorButtons,
384
-        navigatorEventID
385
-      } = _mergeScreenSpecificSettings(params.screen, screenInstanceID, params);
386
-      const passProps = Object.assign({}, params.passProps);
387
-      passProps.navigatorID = navigatorID;
388
-      passProps.screenInstanceID = screenInstanceID;
389
-      passProps.navigatorEventID = navigatorEventID;
390
       return (
415
       return (
391
         <NavigationControllerIOS
416
         <NavigationControllerIOS
392
           id={navigatorID}
417
           id={navigatorID}
433
   passProps.screenInstanceID = screenInstanceID;
458
   passProps.screenInstanceID = screenInstanceID;
434
   passProps.navigatorEventID = navigatorEventID;
459
   passProps.navigatorEventID = navigatorEventID;
435
 
460
 
461
+  params.navigationParams = {
462
+    screenInstanceID,
463
+    navigatorStyle,
464
+    navigatorButtons,
465
+    navigatorEventID,
466
+    navigatorID
467
+  };
468
+
436
   savePassProps(params);
469
   savePassProps(params);
437
 
470
 
438
   Modal.showLightBox({
471
   Modal.showLightBox({
465
   passProps.screenInstanceID = screenInstanceID;
498
   passProps.screenInstanceID = screenInstanceID;
466
   passProps.navigatorEventID = navigatorEventID;
499
   passProps.navigatorEventID = navigatorEventID;
467
 
500
 
501
+  params.navigationParams = {
502
+    screenInstanceID,
503
+    navigatorStyle,
504
+    navigatorButtons,
505
+    navigatorEventID,
506
+    navigatorID
507
+  };
508
+
468
   Notification.show({
509
   Notification.show({
469
     component: params.screen,
510
     component: params.screen,
470
     passProps: passProps,
511
     passProps: passProps,
498
 
539
 
499
   if (params.tabs) {
540
   if (params.tabs) {
500
     _.forEach(params.tabs, (tab) => {
541
     _.forEach(params.tabs, (tab) => {
501
-      if(!tab.passProps) {
542
+      if (!tab.passProps) {
502
         tab.passProps = params.passProps;
543
         tab.passProps = params.passProps;
503
       }
544
       }
504
       savePassProps(tab);
545
       savePassProps(tab);