<commit_before>define([
    'jquery',
    'vellum/core'
], function (
    $
) {
    $.vellum.plugin('windowManager', {
        minHeight: 200,
        bottomOffset: 0
    }, {
        init: function () {
            var _this = this,
                opts = this.opts().windowManager,
                adjustToWindow = function () { _this.adjustToWindow(); };

            $('.fd-scrollable').on('DOMMouseScroll mousewheel', function (ev) {
                // copied from http://jsfiddle.net/TroyAlford/4wrxq/1/
                var $this = $(this),
                    scrollTop = this.scrollTop,
                    scrollHeight = this.scrollHeight,
                    height = $this.height(),
                    delta = ev.originalEvent.wheelDelta,
                    up = delta > 0;

                var prevent = function() {
                    ev.stopPropagation();
                    ev.preventDefault();
                    ev.returnValue = false;
                    return false;
                };

                if (!up && -delta > scrollHeight - height - scrollTop) {
                    // Scrolling down, but this will take us past the bottom.
                    $this.scrollTop(scrollHeight);
                    return prevent();<commit_msg>add comment to double scrolling fix<commit_after>define([
    'jquery',
    'vellum/core'
], function (
    $
) {
    $.vellum.plugin('windowManager', {
        minHeight: 200,
        bottomOffset: 0
    }, {
        init: function () {
            var _this = this,
                opts = this.opts().windowManager,
                adjustToWindow = function () { _this.adjustToWindow(); };

            $('.fd-scrollable').on('DOMMouseScroll mousewheel', function (ev) {
                /*
                 * Copied from http://jsfiddle.net/TroyAlford/4wrxq/1/
                 *
                 * if your mouse is over the one of vellum's scrollable sections
                 * and you use your mouse wheel (or touchpad, etc.) to scroll
                 * you no longer start scrolling the window when the pane reaches the top/bottom
                 *
                 * up/down keys still have double scrolling behavior,
                 * and you can still click the up down arrows on either scroll bar
                 * for OS's that have that (i.e. most except macs)
                 */
                var $this = $(this),
                    scrollTop = this.scrollTop,
                    scrollHeight = this.scrollHeight,
                    height = $this.height(),
                    delta = ev.originalEvent.wheelDelta,
                    up = delta > 0;

                var prevent = function() {
                    ev.stopPropagation();
                    ev.preventDefault();
                    ev.returnValue = false;
                    return false;
                };

                if (!up && -delta > scrollHeight - height - scrollTop) {
                    // Scrolling down, but this will take us past the bottom.
                    $this.scrollTop(scrollHeight);
                    return prevent();
{'fraction_non_alphanumeric': 0.0999677523379555, 'fraction_numerical': 0.004514672686230248, 'mean_word_length': 1.262582056892779, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4282148', 'n_tokens_mistral': 784, 'n_tokens_neox': 718, 'n_words': 204}