<commit_before>define('titleScreen', ['util', 'vent'], function( util, vent ){

    var init,
        bindEvents,
        screens,
        elem,
        next,
        handler,
        currentIndex,
        cacheElements;


    init = function(){
        cacheElements();
        currentIndex = 0;
        screens[0].classList.add('on');
        bindEvents();
    };


    cacheElements = function(){
        var nl = util.QSA('.title');
        elem = util.getById('title-screen');
        screens = [];
        for (var i = 0; i < nl.length; i++) {
            screens.push(nl[i]);
        }
    };


    bindEvents = function(){
        vent.on('keydown', handler);
    };


    handler = function( ev ){
        if ( ev.keyCode === 13 ){
            next();
        }
    };


    next = function(){
        currentIndex++;

        if ( !screens[currentIndex] ) {
            screens[currentIndex-1].classList.remove('on');
            elem.style.display = 'none';
            vent.emit('start-game');
            vent.off('update', handler);
            return;
        }

        screens[currentIndex-1].classList.remove('on');
        screens[currentIndex].classList.add('on');
    };


    init();

});
<commit_msg>unbind from keydown event not update<commit_after>define('titleScreen', ['util', 'vent'], function( util, vent ){

    var init,
        bindEvents,
        screens,
        elem,
        next,
        handler,
        currentIndex,
        cacheElements;


    init = function(){
        cacheElements();
        currentIndex = 0;
        screens[0].classList.add('on');
        bindEvents();
    };


    cacheElements = function(){
        var nl = util.QSA('.title');
        elem = util.getById('title-screen');
        screens = [];
        for (var i = 0; i < nl.length; i++) {
            screens.push(nl[i]);
        }
    };


    bindEvents = function(){
        vent.on('keydown', handler);
    };


    handler = function( ev ){
        if ( ev.keyCode === 13 ){
            next();
        }
    };


    next = function(){
        currentIndex++;

        if ( !screens[currentIndex] ) {
            screens[currentIndex-1].classList.remove('on');
            elem.style.display = 'none';
            vent.emit('start-game');
            vent.off('keydown', handler);
            return;
        }

        screens[currentIndex-1].classList.remove('on');
        screens[currentIndex].classList.add('on');
    };


    init();

});

{'fraction_non_alphanumeric': 0.15789473684210525, 'fraction_numerical': 0.005668016194331984, 'mean_word_length': 1.6800433839479392, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3270455', 'n_tokens_mistral': 719, 'n_tokens_neox': 706, 'n_words': 133}