<commit_before>// Based on https://stackoverflow.com/questions/5802467/prevent-scrolling-of-parent-element

$.fn.scrollLock = function () {
    return $(this).on('mousewheel', function (e) {
        var $this = $(this);
        var scrollTop = $this.scrollTop();
        var scrollHeight = this.scrollHeight;
        var height = $this.height();
        var up = e.deltaY > 0;

        if (!up && -e.deltaY > scrollHeight - height - scrollTop) {
            // Scrolling down, but this will take us past the bottom
            $this.scrollTop(scrollHeight - height);
            e.stopPropagation();<commit_msg>Improved scrolling lock.<commit_after>// Based on https://stackoverflow.com/questions/5802467/prevent-scrolling-of-parent-element

$.fn.scrollLock = function () {
    return $(this).on('mousewheel', function (e) {
        var $this = $(this);
        var scrollTop = $this.scrollTop();
        var scrollHeight = this.scrollHeight;
        var height = $this.height();
        var up = e.deltaY > 0;

        // If there is no scroller, don't do anything
        if (scrollHeight === height) return;

        if (!up && -e.deltaY > scrollHeight - height - scrollTop) {
            // Scrolling down, but this will take us past the bottom
            $this.scrollTop(scrollHeight - height);
            e.stopPropagation();
{'fraction_non_alphanumeric': 0.13278319579894973, 'fraction_numerical': 0.012003000750187547, 'mean_word_length': 2.3772151898734175, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '6514738', 'n_tokens_mistral': 391, 'n_tokens_neox': 374, 'n_words': 103}