<commit_before>/* contains random bits and pieces we neede to make the U6 UI behave */

(function ($) {
    

    $(document).ready(function () {
        scaleScrollables("body");

        $(window).bind("resize", function () {
            scaleScrollables("body");
        });

        $("body").click(function (event) {
            var el = event.target.nodeName;
            var pEl = event.target.parentElement.nodeName;

            //first check the simple elements
            if (el != "INPUT" && el != "A" && el != "BUTTON" &&
                pEl != "A" && pEl != "BUTTON" && pEl != "LABEL") {
                            
                //NOTE: The IMG needs to be added because a ton of buttons in the legacy editors are actually just images with click handlers! 
                if (el == "IMG" && $(event.target.parentElement).hasClass("btn-group")) {
                    return;
                }

                UmbClientMgr.closeModalWindow(undefined);
            }
        });
    });     

    function scaleScrollables(selector) {
        $(".umb-scrollable").each(function() {
            var el = jQuery(this);
            var totalOffset = 0;
            var offsety = el.data("offset-y");

            if (offsety != undefined)
                totalOffset += offsety;

            el.height($(window).height() - (el.offset().top + totalOffset));
        });
    }
    
})(jQuery);<commit_msg>Better click detection for modal closing<commit_after>/* contains random bits and pieces we neede to make the U6 UI behave */

(function ($) {

    $(document).ready(function () {
        scaleScrollables("body");

        $(window).bind("resize", function () {
            scaleScrollables("body");
        });

        $("body").click(function (event) {
            var el = event.target.nodeName;
            var els = ["INPUT","A","BUTTON"];

            if(els.indexOf(el) >= 0){return;}

            var parents = $(event.target).parents("a,button");
            if(parents.length > 0){
                return;
            }

            var click = $(event.target).attr('onClick');
            if(click){
                return;
            }


            UmbClientMgr.closeModalWindow(undefined);
        });
    });     

    function scaleScrollables(selector) {
        $(".umb-scrollable").each(function() {
            var el = jQuery(this);
            var totalOffset = 0;
            var offsety = el.data("offset-y");

            if (offsety != undefined)
                totalOffset += offsety;

            el.height($(window).height() - (el.offset().top + totalOffset));
        });
    }
    
})(jQuery);
{'fraction_non_alphanumeric': 0.14744801512287334, 'fraction_numerical': 0.002268431001890359, 'mean_word_length': 1.6592964824120604, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1554348', 'n_tokens_mistral': 722, 'n_tokens_neox': 688, 'n_words': 163}