<commit_before>(function () {
    'use strict';
    /**
     * @ngdoc module
     * @name popperService
     * @description
     *
     * Provides a service wrapper for popper.js
     *
     */

    angular.module('angular-popper', [])
        .controller('popperCtrl',
            ['$log', '$element', '$document', '$timeout', function ($log, $element, $document, $timeout) {
                var popup;
                var popperTrigger = $element[0];
                var popper = this.popperTrigger;
                var popperOptions = this.popperOptions;

                function open(e) {
                    e.stopPropagation();
                    $log.debug('open');
                    $element.off('click', open);
                    $element.on('click', close);

                    $document.on('click', close);
                    $document.on('keydown', escapeKey);
                    popup = new Popper(popperTrigger, popper, popperOptions);
                }


                function close(e) {
                    e.stopPropagation();
                    $log.debug('close');
                    $document.off('click', close);
                    $document.off('keydown', escapeKey);
                    $element.off('click', close);
                    $element.on('click', open);
                    if (popup) {
                        popup.destroy()
                    }
                }

                function escapeKey(e) {
                    if (e.which === 27) {
                        $timeout(function () {
                            close(e)
                        });
                    }
                }


                function initalize() {
                    $element.on('click', open);
                }

                initalize();
            }])
        .directive('popperTrigger', [function () {
            return {
                restrict: 'A',
                replace: false,
                bindToController: {
                    popperTrigger: '=',
                    popperOptions: '='
                },
                scope: true,
                controller: 'popperCtrl',
                controllerAs: 'Popper'
            }
        }]);
})();<commit_msg>don't close when click on inner element<commit_after>(function () {
    'use strict';
    /**
     * @ngdoc module
     * @name popperService
     * @description
     *
     * Provides a service wrapper for popper.js
     *
     */

    angular.module('angular-popper', [])
        .controller('popperCtrl',
            ['$log', '$element', '$document', '$timeout', function ($log, $element, $document, $timeout) {
                var popup;
                var popperTrigger = $element[0];
                var popper = this.popperTrigger;
                var popperOptions = this.popperOptions;

                function open(e) {
                    e.stopPropagation();
                    $log.debug('open');
                    $element.off('click', open);
                    $element.on('click', close);

                    $document.on('click', close);
                    $document.on('keydown', escapeKey);
                    popup = new Popper(popperTrigger, popper, popperOptions);
                }

                function getPopupBubble(){
                    return popup._popper;
                }

                function close(e) {
                    e.stopPropagation();

                    var toggleElement = getPopupBubble();
                    if (e && toggleElement && toggleElement.contains(e.target)) {
                        return;
                    }

                    $log.debug('close');
                    $document.off('click', close);
                    $document.off('keydown', escapeKey);
                    $element.off('click', close);
                    $element.on('click', open);
                    if (popup) {
                        popup.destroy()
                    }


                }

                function escapeKey(e) {
                    if (e.which === 27) {
                        $timeout(function () {
                            close(e)
                        });
                    }
                }

                function initalize() {
                    $element.on('click', open);
                }

                initalize();
            }])
        .directive('popperTrigger', [function () {
            return {
                restrict: 'A',
                replace: false,
                bindToController: {
                    popperTrigger: '=',
                    popperOptions: '='
                },
                scope: true,
                controller: 'popperCtrl',
                controllerAs: 'Popper'
            }
        }]);
})();
{'fraction_non_alphanumeric': 0.11929677689409796, 'fraction_numerical': 0.0012557555462536626, 'mean_word_length': 1.0020946795140344, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3602961', 'n_tokens_mistral': 1202, 'n_tokens_neox': 1083, 'n_words': 210}