<commit_before>"use strict";

/*global module, require*/

var d3 = require("d3");

module.exports = function() {
    var disable = 0;
    
    if (window.frameElement) {
	window.parent.addEventListener("scroll", function() {
	    if (!disable) {
		window.frameElement.style.pointerEvents = "none";
	    }
	    
	    disable++;
	    
	    window.setTimeout(
		function() {
		    disable--;

		    if (!disable) {
			window.frameElement.style.pointerEvents = "auto";
		    }
		},
		500
	    );
	});
    }
};<commit_msg>Made this a little more robust in the case that the iframe get deleted.<commit_after>"use strict";

/*global module, require*/

var d3 = require("d3"),
    pointerEvents = "pointer-events";

module.exports = function() {
    var disable = 0;
    
	if (window.frameElement) {
	    var iframe = window.frameElement;
	    
	window.parent.addEventListener("scroll", function() {
	    if (!iframe) {
		return;
	    }

	    if (disable === 0) {
		d3.select(iframe)
		    .style(pointerEvents, "none");
	    }
	    
	    disable++;
	    
	    window.setTimeout(
		function() {
		    if (disable > 0) {
			disable--;
		    }

		    if (!iframe) {
			return;
		    }

		    if (disable === 0) {
			d3.select(iframe)
			    .style(pointerEvents, "auto");
		    }
		},
		500
	    );
	});
    }
};
{'fraction_non_alphanumeric': 0.15360983102918588, 'fraction_numerical': 0.013056835637480798, 'mean_word_length': 2.2014742014742015, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '3890410', 'n_tokens_mistral': 494, 'n_tokens_neox': 415, 'n_words': 91}