mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 21:47:32 -05:00 
			
		
		
		
	Working on the time tracker
This commit is contained in:
		
							parent
							
								
									33ea69474c
								
							
						
					
					
						commit
						6fd6cf0ec5
					
				@ -112,8 +112,8 @@
 | 
			
		||||
            bottom: 0;
 | 
			
		||||
            width: 6px;
 | 
			
		||||
            content: "";
 | 
			
		||||
			background-color: #d9534f; /* red */
 | 
			
		||||
			xbackground-color: #36c157; /* green */
 | 
			
		||||
			background-color: #36c157; /* green */
 | 
			
		||||
			xbackground-color: #d9534f; /* red */
 | 
			
		||||
			xbackground-color: orange; /* orange */
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -221,7 +221,7 @@
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
								<table class="table times-table" data-bind="event: { change: selectedTask().onChange }" style="margin-bottom: 0px !important;">
 | 
			
		||||
									<tbody data-bind="foreach: selectedTask().time_log">
 | 
			
		||||
									<tbody data-bind="foreach: selectedTask().sortedTimes">
 | 
			
		||||
										<tr data-bind="event: { mouseover: onMouseOver, mouseout: onMouseOut }">
 | 
			
		||||
											<td style="padding: 0 6px 10px 0">
 | 
			
		||||
												{!! Former::text('date')
 | 
			
		||||
 | 
			
		||||
@ -385,6 +385,10 @@
 | 
			
		||||
                    task.setProject(self.selectedProject());
 | 
			
		||||
                } else if (self.selectedClient()) {
 | 
			
		||||
                    task.setClient(self.selectedClient());
 | 
			
		||||
                    setTimeout(function() {
 | 
			
		||||
                        $('select#client_id').trigger('change');
 | 
			
		||||
                    }, 1);
 | 
			
		||||
 | 
			
		||||
                } else {
 | 
			
		||||
                    task.description(self.filter());
 | 
			
		||||
                }
 | 
			
		||||
@ -800,6 +804,19 @@
 | 
			
		||||
            return self.public_id();
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        self.sortedTimes = ko.computed(function() {
 | 
			
		||||
            var times = self.time_log();
 | 
			
		||||
            times.sort(function (left, right) {
 | 
			
		||||
                if (! left.startTime()) {
 | 
			
		||||
                    return 1;
 | 
			
		||||
                } else if (! right.startTime()) {
 | 
			
		||||
                    return -1;
 | 
			
		||||
                }
 | 
			
		||||
                return left.startTime() - right.startTime();
 | 
			
		||||
            });
 | 
			
		||||
            return times;
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        self.isRunning = ko.computed(function() {
 | 
			
		||||
            var timeLog = self.time_log();
 | 
			
		||||
            if (! timeLog.length) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user