Quellcode durchsuchen

highlight newly copied record

master
patrick vor 6 Jahren
Ursprung
Commit
98d29a30a1
3 geänderte Dateien mit 39 neuen und 3 gelöschten Zeilen
  1. +15
    -1
      css/bts_timesheet.css
  2. +1
    -0
      html/job.html
  3. +23
    -2
      js/bts_timesheet.js

+ 15
- 1
css/bts_timesheet.css Datei anzeigen

box-shadow: 1px 1px 10px #f50202; box-shadow: 1px 1px 10px #f50202;
} }


.divTable.highlight.newcopy{
box-shadow: 1px 1px 10px orange;
border:5px orange solid;
}



.divTableRow { .divTableRow {
display: table-row; display: table-row;
position: absolute; position: absolute;
} }


div.bsave span.ticon-copy{
display: none;
}
div.bsave span.ticon-save{
display: inline-block;
}


div.bsave.saved span{
div.bsave.saved span.ticon-save{
display: none; display: none;
} }
div.bsave.saved span.ticon-copy{
display: inline-block;
}




/* short code for the table */ /* short code for the table */

+ 1
- 0
html/job.html Datei anzeigen

</div> </div>
<div class="divTableCell bsave saved"> <div class="divTableCell bsave saved">
<span class="ticon ticon-save"></span> <span class="ticon ticon-save"></span>
<span class="ticon ticon-copy"></span>
</div> </div>
</div> </div>
<div class="divTableRow errmsg"> <div class="divTableRow errmsg">

+ 23
- 2
js/bts_timesheet.js Datei anzeigen

var table = $(this).closest('div.divTable'); var table = $(this).closest('div.divTable');
table.data().job.do_save_record(); table.data().job.do_save_record();
}); });
$(document).on('click', 'span.ticon.ticon-copy', function(){
if (!confirm("make a copy of this job?"))
return;
var table = $(this).closest('div.divTable');
var job = table.data().job;
clone_data_create_new_job(job.get_record_from_ui());
});
class Job{ //save data for the record, and display it as GUI class Job{ //save data for the record, and display it as GUI
constructor(data){ constructor(data){
this.el.removeClass('emptyrecord'); this.el.removeClass('emptyrecord');
} }
mark_highlight_me(ms){
this.el.addClass('blink_me');
this.el.addClass('highlight');
this.el.addClass('newcopy');
var self = this;
setTimeout(function(){
self.el.removeClass('blink_me');
self.el.removeClass('highlight');
self.el.removeClass('newcopy');
},ms);
}
is_start_valid(){ is_start_valid(){
var s = this.get_start(); var s = this.get_start();
return is_valid_date_str(s); return is_valid_date_str(s);
}); });
jobs.forEach(function(e){ jobs.forEach(function(e){
clone_data_create_new_job(e.data);
clone_data_create_new_job(e.get_record_from_ui());
}); });
}); });
f = new Date(f.setDate(f1)); f = new Date(f.setDate(f1));
data.finish = format_date_time(f); data.finish = format_date_time(f);
} }
new Job(data);
var newj = new Job(data);
newj.mark_highlight_me(1000);//for 1 second;
} }
function is_valid_date_str(val){ function is_valid_date_str(val){

Laden…
Abbrechen
Speichern