<commit_before>Template.courseToolbar.events({
    'click #edit-course':function(event, template){
        //Edit Mode is on
        Session.set('editMode', true);
        //enables inline-editing
        //TODO: think about better place
        $('.lesson-link').editable();
        $('#section-title').editable();
        $('#course-title').editable();
    },
    'click #save-course-edit': function () {
        //Edit Mode is off
        Session.set('editMode', false);
        //disables inline-editing
        $('.lesson-link').editable('destroy');
        $('#section-title').editable('destroy');
        $('#course-title').editable('destroy');
    },
    'click #cancel-course-edit': function () {
        //confirmation alert
        //if yes,
        if (confirm('Are you sure you want to cancel, you will loose your last changes?')) {
            //revert changes: editMode is false
            Session.set('editMode', false);
            //clear entered data into rich-text-editor
            //clear entered data into x-editable fields
            //disables inline-editing
            $('.lesson-link').editable('disable');
            $('.lesson-link').editable('destroy');
            $('#section-title').editable('destroy');
            $('#course-title').editable('destroy');
            //if no,
        } else {
            //do nothing set session true
            Session.set('editMode', true);
        }
    }
});
<commit_msg>Prevent lesson title from displaying twice.<commit_after>Template.courseToolbar.events({
    'click #edit-course':function(event, template){
        //Edit Mode is on
        Session.set('editMode', true);
        //enables inline-editing
        //TODO: think about better place
        $('.lesson-link').editable({
            // Make sure text doesn't display twice after saving
            display: false
        });
        $('#section-title').editable();
        $('#course-title').editable();
    },
    'click #save-course-edit': function () {
        //Edit Mode is off
        Session.set('editMode', false);
        //disables inline-editing
        $('.lesson-link').editable('destroy');
        $('#section-title').editable('destroy');
        $('#course-title').editable('destroy');
    },
    'click #cancel-course-edit': function () {
        //confirmation alert
        //if yes,
        if (confirm('Are you sure you want to cancel, you will loose your last changes?')) {
            //revert changes: editMode is false
            Session.set('editMode', false);
            //clear entered data into rich-text-editor
            //clear entered data into x-editable fields
            //disables inline-editing
            $('.lesson-link').editable('disable');
            $('.lesson-link').editable('destroy');
            $('#section-title').editable('destroy');
            $('#course-title').editable('destroy');
            //if no,
        } else {
            //do nothing set session true
            Session.set('editMode', true);
        }
    }
});

{'fraction_non_alphanumeric': 0.16199274166941605, 'fraction_numerical': 0.0, 'mean_word_length': 1.9930898321816386, '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': '4615039', 'n_tokens_mistral': 787, 'n_tokens_neox': 798, 'n_words': 193}