mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 19:24:42 -04:00
Working on time tracker
This commit is contained in:
parent
d7371aed2b
commit
6c5dc29749
@ -2455,6 +2455,7 @@ $LANG = array(
|
||||
'no_description' => 'No Description',
|
||||
'time_tracker_login' => 'Time Tracker Login',
|
||||
'save_or_discard' => 'Please save or discard your changes',
|
||||
'discard_changes' => 'Discard Changes',
|
||||
|
||||
);
|
||||
|
||||
|
@ -362,14 +362,20 @@
|
||||
model.onArchiveClick();
|
||||
});
|
||||
|
||||
/*
|
||||
$(window).on('beforeunload', function () {
|
||||
console.log('beforeunload');
|
||||
if (model.selectedTask() && model.formChanged()) {
|
||||
console.log('changed');
|
||||
swal("{{ trans('texts.save_or_discard') }}");
|
||||
return false;
|
||||
//return trans('texts.save_or_discard');
|
||||
} else {
|
||||
console.log('not changed');
|
||||
return undefined;
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
/*
|
||||
$( window ).scroll(function() {
|
||||
|
@ -85,7 +85,7 @@
|
||||
task.update(task.data);
|
||||
}
|
||||
self.formChanged(false);
|
||||
});
|
||||
}, "{{ trans('texts.discard_changes') }}");
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -430,8 +430,10 @@
|
||||
for (var i=0; i<parts.length; i++) {
|
||||
var part = parts[i];
|
||||
var isMatch = false;
|
||||
if (self.description().toLowerCase().indexOf(part) >= 0) {
|
||||
isMatch = true;
|
||||
if (self.description()) {
|
||||
if (self.description().toLowerCase().indexOf(part) >= 0) {
|
||||
isMatch = true;
|
||||
}
|
||||
}
|
||||
if (self.project()) {
|
||||
var projectName = self.project().name();
|
||||
@ -457,7 +459,6 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
self.isStartEnabled(false);
|
||||
if (self.isRunning()) {
|
||||
var data = 'is_running=0&';
|
||||
var time = self.lastTime();
|
||||
@ -468,7 +469,11 @@
|
||||
time.startTime(moment().unix());
|
||||
self.addTime(time);
|
||||
}
|
||||
self.save(data + 'time_log=' + JSON.stringify(self.times()));
|
||||
|
||||
if (self.public_id()) {
|
||||
self.isStartEnabled(false);
|
||||
self.save(data + 'time_log=' + JSON.stringify(self.times()));
|
||||
}
|
||||
}
|
||||
|
||||
self.listItemState = ko.computed(function() {
|
||||
@ -515,6 +520,9 @@
|
||||
});
|
||||
|
||||
self.description.truncated = ko.computed(function() {
|
||||
if (! self.description()) {
|
||||
return '';
|
||||
}
|
||||
return truncate(self.description(), self.actionButtonVisible() ? 35 : 60);
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user