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,6 +216,14 @@ function navigatorPush(navigator, params) {
216 216
   passProps.screenInstanceID = screenInstanceID;
217 217
   passProps.navigatorEventID = navigatorEventID;
218 218
 
219
+  params.navigationParams = {
220
+    screenInstanceID,
221
+    navigatorStyle,
222
+    navigatorButtons,
223
+    navigatorEventID,
224
+    navigatorID: navigator.navigatorID
225
+  };
226
+
219 227
   savePassProps(params);
220 228
 
221 229
   Controllers.NavigationControllerIOS(navigator.navigatorID).push({
@@ -260,6 +268,14 @@ function navigatorResetTo(navigator, params) {
260 268
   passProps.screenInstanceID = screenInstanceID;
261 269
   passProps.navigatorEventID = navigatorEventID;
262 270
 
271
+  params.navigationParams = {
272
+    screenInstanceID,
273
+    navigatorStyle,
274
+    navigatorButtons,
275
+    navigatorEventID,
276
+    navigatorID: navigator.navigatorID
277
+  };
278
+
263 279
   savePassProps(params);
264 280
 
265 281
   Controllers.NavigationControllerIOS(navigator.navigatorID).resetTo({
@@ -374,19 +390,28 @@ function showModal(params) {
374 390
     return;
375 391
   }
376 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 413
   const Controller = Controllers.createClass({
378 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 415
       return (
391 416
         <NavigationControllerIOS
392 417
           id={navigatorID}
@@ -433,6 +458,14 @@ function showLightBox(params) {
433 458
   passProps.screenInstanceID = screenInstanceID;
434 459
   passProps.navigatorEventID = navigatorEventID;
435 460
 
461
+  params.navigationParams = {
462
+    screenInstanceID,
463
+    navigatorStyle,
464
+    navigatorButtons,
465
+    navigatorEventID,
466
+    navigatorID
467
+  };
468
+
436 469
   savePassProps(params);
437 470
 
438 471
   Modal.showLightBox({
@@ -465,6 +498,14 @@ function showInAppNotification(params) {
465 498
   passProps.screenInstanceID = screenInstanceID;
466 499
   passProps.navigatorEventID = navigatorEventID;
467 500
 
501
+  params.navigationParams = {
502
+    screenInstanceID,
503
+    navigatorStyle,
504
+    navigatorButtons,
505
+    navigatorEventID,
506
+    navigatorID
507
+  };
508
+
468 509
   Notification.show({
469 510
     component: params.screen,
470 511
     passProps: passProps,
@@ -498,7 +539,7 @@ function savePassProps(params) {
498 539
 
499 540
   if (params.tabs) {
500 541
     _.forEach(params.tabs, (tab) => {
501
-      if(!tab.passProps) {
542
+      if (!tab.passProps) {
502 543
         tab.passProps = params.passProps;
503 544
       }
504 545
       savePassProps(tab);