I'm fairly new to JavaScript. I would like some feedback on the naming and grouping of the following code. Is there any change that will make it more readable?
Template.documentPage.events({
'click .hint-text': function(e) {
e.preventDefault()
var currentHintId = $(e.target).attr('id')
Session.set('currentHintId', currentHintId)
$('.hint-popup').show()
},
'click .hint-submit': function(e) {
e.preventDefault()
var currentHintId = Session.get('currentHintId')
var popupInput = $('.hint-popup input').val()
$('#' + currentHintId).text(popupInput)
Documents.update(this._id, {$set: {content: $('.content').html()}}, function() {
console.log('Saved.')
})
$('.hint-popup').hide()
$('.hint-popup input').val('Enter text')
}
})