mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Working on time tracker
This commit is contained in:
parent
a89a0c5bfc
commit
f807883d3f
@ -37,6 +37,14 @@
|
||||
});
|
||||
}
|
||||
|
||||
function openTimeTracker() {
|
||||
var width = 1000;
|
||||
var height = 800;
|
||||
var left = (screen.width/2)-(width/4);
|
||||
var top = (screen.height/2)-(height/1.5);
|
||||
window.open("{{ url('/time_tracker') }}", "time-tracker", "width="+width+",height="+height+",scrollbars=no,toolbar=no,screenx="+left+",screeny="+top+",location=no,titlebar=no,directories=no,status=no,menubar=no");
|
||||
}
|
||||
|
||||
window.loadedSearchData = false;
|
||||
function onSearchBlur() {
|
||||
$('#search').typeahead('val', '');
|
||||
|
@ -100,6 +100,7 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{!! Button::normal(trans('texts.time_tracker'))->asLinkTo('javascript:openTimeTracker()')->appendIcon(Icon::create('time')) !!}
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->can('create', $entityType) && empty($vendorId))
|
||||
|
@ -485,7 +485,9 @@
|
||||
toastr.info(message, false, options);
|
||||
}
|
||||
|
||||
sendKeepAlive();
|
||||
if (model.isDesktop()) {
|
||||
sendKeepAlive();
|
||||
}
|
||||
|
||||
function setButtonSize() {
|
||||
if ($(window).width() > 350) {
|
||||
@ -500,7 +502,7 @@
|
||||
setButtonSize();
|
||||
|
||||
$(window).on('beforeunload', function () {
|
||||
if (navigator.userAgent == 'Time Tracker') {
|
||||
if (model.isDesktop()) {
|
||||
return undefined;
|
||||
}
|
||||
if (model.selectedTask() && model.formChanged()) {
|
||||
|
@ -13,6 +13,10 @@
|
||||
self.selectedClient = ko.observable(false);
|
||||
self.selectedProject = ko.observable(false);
|
||||
|
||||
self.isDesktop = function() {
|
||||
return navigator.userAgent == 'Time Tracker';
|
||||
}
|
||||
|
||||
self.onSaveClick = function() {
|
||||
if (! model.selectedTask() || ! model.formChanged()) {
|
||||
return;
|
||||
@ -28,7 +32,16 @@
|
||||
}
|
||||
|
||||
self.onRefreshClick = function() {
|
||||
location.reload();
|
||||
if (self.isDesktop()) {
|
||||
if (model.selectedTask() && model.formChanged()) {
|
||||
swal("{{ trans('texts.save_or_discard') }}");
|
||||
return false;
|
||||
} else {
|
||||
location.reload();
|
||||
}
|
||||
} else {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
self.refreshTitle = function() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user