Browse Source

Show back button by default on screen push

Guy Carmeli 8 years ago
parent
commit
c3deae58cc
1 changed files with 10 additions and 0 deletions
  1. 10
    0
      src/deprecated/platformSpecificDeprecated.android.js

+ 10
- 0
src/deprecated/platformSpecificDeprecated.android.js View File

36
 function navigatorPush(navigator, params) {
36
 function navigatorPush(navigator, params) {
37
   addNavigatorParams(params, navigator);
37
   addNavigatorParams(params, navigator);
38
   addNavigatorButtons(params);
38
   addNavigatorButtons(params);
39
+  addTitleBarBackButtonIfNeeded(params);
39
   addNavigationStyleParams(params);
40
   addNavigationStyleParams(params);
40
 
41
 
41
   params.screenId = params.screen;
42
   params.screenId = params.screen;
289
   }
290
   }
290
 }
291
 }
291
 
292
 
293
+function addTitleBarBackButtonIfNeeded(screen) {
294
+  const leftButton = getLeftButton(screen);
295
+  if (!leftButton) {
296
+    screen.leftButton = {
297
+      id: 'back'
298
+    }
299
+  }
300
+}
301
+
292
 function getLeftButton(screen) {
302
 function getLeftButton(screen) {
293
   if (screen.navigatorButtons && screen.navigatorButtons.leftButton) {
303
   if (screen.navigatorButtons && screen.navigatorButtons.leftButton) {
294
     return screen.navigatorButtons.leftButton;
304
     return screen.navigatorButtons.leftButton;