Adding hover-able icons to timeline entries.
- Added notes and delete icons right and left entry marks respectively. - Notes icon slide toggles the notes display (hidden by default).
This commit is contained in:
@ -92,6 +92,7 @@ $(document).ready(function(){
|
||||
className: 'entry',
|
||||
|
||||
events: {
|
||||
"click img.notes-icon" : "toggleNotes",
|
||||
"dblclick div.mark" : "editMark",
|
||||
"dblclick div.timestamp" : "editTimestamp",
|
||||
"keypress .mark-input" : "updateOnEnter",
|
||||
@ -100,7 +101,7 @@ $(document).ready(function(){
|
||||
|
||||
initialize: function(options) {
|
||||
_.bindAll(this, 'render', 'close', 'editTImestamp',
|
||||
'editMark', 'updateOnEnter', 'getViewModel');
|
||||
'editMark', 'updateOnEnter', 'getViewModel', 'toggleNotes');
|
||||
this.model.bind('change', this.render);
|
||||
this.model.view = this;
|
||||
|
||||
@ -124,7 +125,7 @@ $(document).ready(function(){
|
||||
*/
|
||||
update: function() {
|
||||
var data = this.getViewModel();
|
||||
this.$('.mark').text(data.mark);
|
||||
this.$('.mark span').text(data.mark);
|
||||
this.$('.mark-input').val(data.mark);
|
||||
this.$('.timestamp').text(data.start);
|
||||
this.$('.timestamp-input').val(data.timestamp);
|
||||
@ -226,6 +227,10 @@ $(document).ready(function(){
|
||||
return (day > 0 ? day + "d " : "") +
|
||||
(hr > 0 ? hr + "hr " : "") +
|
||||
min + "m ";
|
||||
},
|
||||
|
||||
toggleNotes: function() {
|
||||
this.$('.notes').slideToggle();
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user