Commit e2deddda0d0893eaf7dbc625030093cfa4a146c3

Authored by Caio Almeida
1 parent 632b395e

Ticket #92: Fix back button behavior

ConfJuvApp/builds/confjuv-dev.apk
No preview for this file type
ConfJuvApp/www/html/_login.html
... ... @@ -3,7 +3,7 @@
3 3  
4 4 <!-- Login first screen -->
5 5  
6   - <div ng-hide="loginFormDisplayed || registerFormDisplayed">
  6 + <div ng-hide="loginFormDisplayed || registerFormDisplayed" id="home-screen">
7 7 <h1 class="title">
8 8 <span>Entrar</span>
9 9 </h1>
... ... @@ -31,7 +31,7 @@
31 31  
32 32 <!-- Login form -->
33 33  
34   - <form ng-submit="Login(data)" ng-show="loginFormDisplayed">
  34 + <form ng-submit="Login(data)" ng-show="loginFormDisplayed" id="login-form">
35 35 <h1 class="title">
36 36 <span>Entrar</span>
37 37 <a class="back icon-left ion-reply" ng-click="backToLoginHome()">Voltar</a>
... ... @@ -62,7 +62,7 @@
62 62  
63 63 <!-- Register form -->
64 64  
65   - <form ng-submit="Register(data)" ng-show="registerFormDisplayed" class="register-form" novalidate>
  65 + <form ng-submit="Register(data)" ng-show="registerFormDisplayed" class="register-form" novalidate id="register-form">
66 66 <h1 class="title">
67 67 <span>Registrar</span>
68 68 <a class="back icon-left ion-reply" ng-click="backToLoginHome()">Voltar</a>
... ...
ConfJuvApp/www/index.html
... ... @@ -30,7 +30,7 @@
30 30 <body ng-app="confjuvapp" ng-controller="ProposalCtrl" ng-init="init()" ng-class="{ 'logged-in': loggedIn, 'large': largeScreen }" animation="slide-left-right-ios7">
31 31  
32 32 <ion-view ng-show="introDisplayed">
33   - <ng-include src="'html/_intro.html'"></ng-include>
  33 + <ng-include src="'html/_intro.html?1'"></ng-include>
34 34 </ion-view>
35 35  
36 36 <ion-side-menus id="body" ng-show="!introDisplayed">
... ...
ConfJuvApp/www/js/utils.js
... ... @@ -87,3 +87,10 @@ var ConfJuvAppUtils = {
87 87 return window.localStorage['saw_intro'];
88 88 }
89 89 };
  90 +
  91 +document.addEventListener('backbutton', function(event) {
  92 + if ($('#login-modal').is(':visible')) {
  93 + event.preventDefault();
  94 + navigator.app.exitApp();
  95 + }
  96 +});
... ...