Adding missing actions to the front #28

Merged
PootisPenserHere merged 2 commits from addingMissingActionsToTheFront into master 2018-09-19 05:12:54 +00:00
4 changed files with 19 additions and 3 deletions
Showing only changes of commit 07e0fbbfab - Show all commits

View File

@ -103,6 +103,7 @@
<div class="row col-md-offset-6">
<div class="form-group">
<a href="#" class="btn btn-lg btn-success " onclick="updateEmployee();">Update</a>
<a href="#" class="btn btn-lg btn-primary " onclick="loadView(currentView);">Clear</a>
</div>
</div>
</div>

View File

@ -85,6 +85,7 @@
<div class="row col-md-offset-6">
<div class="form-group">
<a href="#" class="btn btn-lg btn-success " onclick="saveNewEmployee();">Create</a>
<a href="#" class="btn btn-lg btn-primary " onclick="loadView(currentView);">Clear</a>
</div>
</div>
</div>

View File

@ -134,6 +134,7 @@
<div class="row col-md-offset-6">
<div class="form-group">
<a href="#" class="btn btn-lg btn-success " onclick="processSaveActionWorkDay();">Save</a>
<a href="#" class="btn btn-lg btn-primary " onclick="loadView(currentView);">Clear</a>
</div>
</div>
</div>

View File

@ -1,3 +1,6 @@
// will contain the current loaded view
let currentView;
/**
* Destorys the session for the current user and redirects
* back to the login form
@ -59,6 +62,8 @@ function loadView(requestedView){
url: baseUrl + '/html/' + requestedView,
type: 'get',
success:function(data){
currentView = requestedView;
$("#newViewBody").hide().html(data).show('slow');
},
error:function(x,e) {
@ -81,3 +86,11 @@ function loadView(requestedView){
},
});
}
/**
* Reloads the last view that was accessed as a way of fully clearing and
* resetting the values of the form
*/
function clearView(view){
loadView(view);
}