Skip to content

Commit

Permalink
Adicionado indicador de loading
Browse files Browse the repository at this point in the history
  • Loading branch information
leonp967 committed May 14, 2019
1 parent 33ad32d commit cd256da
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 52 deletions.
33 changes: 0 additions & 33 deletions renderer/add.html

This file was deleted.

17 changes: 0 additions & 17 deletions renderer/add.js

This file was deleted.

2 changes: 2 additions & 0 deletions renderer/include-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ <h3 class="text-center">Dados do Documento</h2>
</div>
</div>

<div id="loading" style="display: none" class="loading loading-lg"></div>

<div class="text-center">
<button style="margin-bottom: 10px; margin-top: 5px" id="create-btn" class="btn btn-primary">Confirmar</button>
</div>
Expand Down
1 change: 1 addition & 0 deletions renderer/include-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const InstitutionController = require('../backend/controllers/institution_contro

document.getElementById('create-btn').addEventListener('click', (evt) => {
evt.preventDefault();
document.getElementById('loading').style.display = "block";
let cpf = document.getElementById('cpf').value;
let patientEmail = document.getElementById('email').value;
let date = document.getElementById('date').value;
Expand Down
1 change: 1 addition & 0 deletions renderer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ <h1 class="text-center">Login</h1>
<button id="signup-button" class="btn">Criar conta</button>
</div>
</form>
<div id="loading" style="display: none" class="loading loading-lg"></div>
</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion renderer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const deleteTodo = (e) => {
};

document.getElementById('login-button').addEventListener('click', async(evt) => {
evt.preventDefault();
evt.preventDefault();
document.getElementById('loading').style.display = "block";
const form = document.getElementById('loginForm');
const email = form[0].value;
const senha = form[1].value;
Expand Down
1 change: 1 addition & 0 deletions renderer/institution-home.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
</div>
</div>
<div class="divider"></div>
<div id="loading" style="display: none" class="loading loading-lg"></div>
<div id="results-div"></div>
</div>
<script src="./institution-home.js"></script>
Expand Down
2 changes: 2 additions & 0 deletions renderer/institution-home.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ function showResults(results){
return html;
}, '')

document.getElementById('loading').style.display = "none";
resultsDiv.innerHTML = resultsHtml;
}

Expand All @@ -52,6 +53,7 @@ ipcRenderer.on('show-data', (event, data) => {
};
remote.dialog.showMessageBox(options, (response) => {
if(response == 0){
document.getElementById('loading').style.display = "block";
let results = InstitutionController.decryptPatientData(data);
showResults(results);
}
Expand Down
1 change: 1 addition & 0 deletions renderer/patient-home.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
</div>
</div>
<div class="divider"></div>
<div id="loading" style="display: none" class="loading loading-lg"></div>
<div id="results-div"></div>
</div>
<script src="./patient-home.js"></script>
Expand Down
2 changes: 2 additions & 0 deletions renderer/patient-home.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const dateFormat = require('dateformat');
const TypeEnum = require('../backend/models/types_enum').TypeEnum;

document.getElementById('query-btn').addEventListener('click', () => {
document.getElementById('loading').style.display = "block";
var type = document.getElementById('picker-type').value;
var dateFrom = document.getElementById('date-from').value;
var dateTo = document.getElementById('date-to').value;
Expand All @@ -30,6 +31,7 @@ ipcRenderer.on('query', (event, results) => {
return html;
}, '')

document.getElementById('loading').style.display = "none";
resultsDiv.innerHTML = resultsHtml;
})

Expand Down
1 change: 1 addition & 0 deletions renderer/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ <h1 class="text-center">Cadastro</h1>
<button id="confirm-button" class="btn btn-primary">Confirmar</button>
</div>
</form>
<div id="loading" style="display: none" class="loading loading-lg"></div>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion renderer/signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ipcRenderer.on('signup-check', (event, response) => {

document.getElementById('confirm-button').addEventListener('click', async(evt) => {
evt.preventDefault();

document.getElementById('loading').style.display = "block";
const form = document.getElementById('signupForm');
const email = form[0].value;
const cpf = form[1].value;
Expand Down

0 comments on commit cd256da

Please sign in to comment.