Browse Source

support side menu toggle to specific state (open/close)

talkol 8 years ago
parent
commit
d16d957615
1 changed files with 16 additions and 4 deletions
  1. 16
    4
      src/platformSpecific.ios.js

+ 16
- 4
src/platformSpecific.ios.js View File

@@ -233,10 +233,22 @@ function navigatorSetTitle(navigator, params) {
233 233
 
234 234
 function navigatorToggleDrawer(navigator, params) {
235 235
   const controllerID = navigator.navigatorID.split('_')[0];
236
-  Controllers.DrawerControllerIOS(controllerID + '_drawer').toggle({
237
-    side: params.side,
238
-    animated: params.animated
239
-  });
236
+  if (params.to == 'open') {
237
+    Controllers.DrawerControllerIOS(controllerID + '_drawer').open({
238
+      side: params.side,
239
+      animated: params.animated
240
+    });
241
+  } else if (params.to == 'closed') {
242
+    Controllers.DrawerControllerIOS(controllerID + '_drawer').close({
243
+      side: params.side,
244
+      animated: params.animated
245
+    });
246
+  } else {
247
+    Controllers.DrawerControllerIOS(controllerID + '_drawer').toggle({
248
+      side: params.side,
249
+      animated: params.animated
250
+    });
251
+  }
240 252
 }
241 253
 
242 254
 function navigatorSetButtons(navigator, navigatorEventID, params) {