<commit_before>angular.module('rt.popup', [])
    .factory('Popup', function ($window, $document, $timeout, $compile, $parse) {
        var openedPopup = null;
        var mouseDownInsidePopup = null;
        var template = '<div class="popover"><div ng-include="popupView" onload="$reposition()"></div></div>';

        // Padding towards edges of screen.
        var padding = 10;

        function loseFocus(e) {
            if ( (mouseDownInsidePopup === null || mouseDownInsidePopup === false) && openedPopup && !$.contains(openedPopup.el[0], e.target)) {
                mouseDownInsidePopup = null;
                hidePopup();
            }
        }

        function checkMouseDown(e) {
            if (openedPopup) {
                mouseDownInsidePopup = $.contains(openedPopup.el[0], e.target);
            }
        }

        function hidePopup() {
            if (!openedPopup) {
                return;<commit_msg>Check if event is default prevented when loseFocus (click) is triggered.<commit_after>angular.module('rt.popup', [])
    .factory('Popup', function ($window, $document, $timeout, $compile, $parse) {
        var openedPopup = null;
        var mouseDownInsidePopup = null;
        var template = '<div class="popover"><div ng-include="popupView" onload="$reposition()"></div></div>';

        // Padding towards edges of screen.
        var padding = 10;

        function loseFocus(e) {
            if (e.isDefaultPrevented()) {
                mouseDownInsidePopup = null;
                return;
            }
            if ( (mouseDownInsidePopup === null || mouseDownInsidePopup === false) && openedPopup && !$.contains(openedPopup.el[0], e.target)) {
                mouseDownInsidePopup = null;
                hidePopup();
            }
        }

        function checkMouseDown(e) {
            if (openedPopup) {
                mouseDownInsidePopup = $.contains(openedPopup.el[0], e.target);
            }
        }

        function hidePopup() {
            if (!openedPopup) {
                return;
{'fraction_non_alphanumeric': 0.1324535679374389, 'fraction_numerical': 0.0039100684261974585, 'mean_word_length': 1.9883211678832118, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5779277', 'n_tokens_mistral': 564, 'n_tokens_neox': 550, 'n_words': 120}