Working on time tracker

This commit is contained in:
Hillel Coren 2017-09-25 13:56:00 +03:00
parent 4117c71215
commit 580ef69e2e
2 changed files with 5 additions and 6 deletions

View File

@ -263,7 +263,6 @@
}
function refreshProjectList(forceClear) {
console.log('refreshProjectList...');
var clientId = $('input[name=client_id]').val();
$projectCombobox = $('select#project_id');
$projectCombobox.find('option').remove().end().combobox('refresh');

View File

@ -425,24 +425,24 @@
success: function(response) {
console.log(response);
if (isSelected) {
var isNew = !self.public_id();
self.update(response);
model.formChanged(false);
var clientId = $('input[name=client_id]').val();
if (clientId) {
if (clientId == -1 && response.client) {
var client = response.client;
clients.push(client);
addClientToMaps(client);
refreshClientList();
}
var projectId = $('input[name=project_id]').val();
if (projectId == -1) {
if (projectId == -1 && response.project) {
var project = response.project;
project.client = response.client;
projects.push(project);
addProjectToMaps(project);
refreshProjectList();
}
var isNew = !self.public_id();
self.update(response);
model.formChanged(false);
if (isNew) {
toastr.success("{{ trans('texts.created_task') }}");
} else {