<commit_before>var courseTitleFocusVar = new ReactiveVar(false);

Template.lesson.helpers({
    editClass: function(){
        if (Session.get('editMode')) {
            return 'course-page-content-edit';
        }
    },
    'contentEditable': function () {
        // Return the value of the edit mode session variable
        return Session.get('editMode');
    },
    'courseTitleFocus': function () {
        // Get the value of reactive var
        return courseTitleFocusVar.get();;
    }
});

Template.lesson.events({
    'focus #course-title': function (event, template) {
        courseTitleFocusVar.set(true);
    },
    'blur #course-title': function (event, template) {
        courseTitleFocusVar.set(false);

        // Get course ID from template
        var courseId = this._id;

        // Get the course name from the page element
        var title = $("#course-title").text();

        // Update the course in database
       Courses.update(courseId, {$set: {title: title}});
    }<commit_msg>Additional comments.<commit_after>var courseTitleFocusVar = new ReactiveVar(false);

Template.lesson.helpers({
    editClass: function(){
        if (Session.get('editMode')) {
            return 'course-page-content-edit';
        }
    },
    'contentEditable': function () {
        // Return the value of the edit mode session variable
        // this will reflect in the editmode HTML tag(s)
        return Session.get('editMode');
    },
    'courseTitleFocus': function () {
        // Get the value of reactive var
        return courseTitleFocusVar.get();;
    }
});

Template.lesson.events({
    'focus #course-title': function (event, template) {
        // set variable to indicate title has focus
        courseTitleFocusVar.set(true);
    },
    'blur #course-title': function (event, template) {
        // indicate title has lost focus
        courseTitleFocusVar.set(false);

        // Get course ID from template
        var courseId = this._id;

        // Get the course name from the page element
        var title = $("#course-title").text();

        // Update the course in database
       Courses.update(courseId, {$set: {title: title}});
    }
{'fraction_non_alphanumeric': 0.12414109024278516, 'fraction_numerical': 0.0, 'mean_word_length': 2.4125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4319419', 'n_tokens_mistral': 594, 'n_tokens_neox': 583, 'n_words': 171}