Skip to content

Commit

Permalink
[minor] After picking date - jump to editing next field(i.e. "label")
Browse files Browse the repository at this point in the history
  • Loading branch information
emilisto committed May 17, 2012
1 parent 2137713 commit 0c6a85f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion public/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ this.ExpenseView = Backbone.View.extend({
$('html').off('click', this._clickOutside);
},
edit: function(field) {
var self = this;

this.trigger('editing');
this.editing = true;

Expand All @@ -141,7 +143,11 @@ this.ExpenseView = Backbone.View.extend({
});

$('input[name="date"]', this.el).datepicker({
dateFormat: 'd M -y'
dateFormat: 'd M -y',
onClose: function() {
var td = $('td[rel="date"]', self.el).next('td').children('input');
td.focus();
}
});

// If user clicks outside the row, cancel edit
Expand Down

0 comments on commit 0c6a85f

Please sign in to comment.