<commit_before>angular.module('ui.dropdown', []);

angular.module('ui.dropdown').directive('dropdown', ['$document',
    function($document) {
        return {
            restrict: 'E',
            transclude: true,
            templateUrl: '/src/dropdown.tmpl.html',
            scope: {
                dropdownTitle: '=',
                dropdownClass: '@'
            },
            link: function(scope, element, attrs) {

                // setup dropdownEl
                var dropdownEl = angular.element(element.children()[0]);
                dropdownEl.find('button').addClass(scope.dropdownClass);

        
                scope.toggleSelect = function() {
                    if(dropdownEl.hasClass('open')) {
                        dropdownEl.removeClass('open');
                        $document.unbind('click', clickHandler);
                    }
                    else {
                        dropdownEl.addClass('open');
                        $document.bind('click', clickHandler);
                    }
                }

                function clickHandler(event) {
                    if (elementMatchesAnyInArray(event.target, element.find(event.target.tagName)))
                        return;
                    dropdownEl.removeClass('open');
                    $document.unbind('click', clickHandler);
                    scope.$apply();
                }

                var elementMatchesAnyInArray = function (element, elementArray) {
                    for (var i = 0; i < elementArray.length; i++)
                        if (element == elementArray[i])
                            return true;
                    return false;
                }
        
            }
        }
    }
]);

angular.module('dropdown-tpls.angular.js', [])
.run(['$templateCache', function($templateCache) {
    $templateCahce.put('dropdown-tpls.angular.js',
        "<div class=\"dropdown\">\n" +
            "<button ng-click=\"toggleSelect()\">\n" +
                "<span >{{dropdownTitle}}</span>\n" +
                "<span class=\"caret\"></span>\n" +
            "</button>\n" +
            "<div class=\"dropdown-menu\" ng-transclude></div>\n" +
        "</div>\n");
}])<commit_msg>Fixes to embedded template<commit_after>angular.module('ui.dropdown', ['dropdown.tmpl.html']);

angular.module('ui.dropdown').directive('dropdown', ['$document',
    function($document) {
        return {
            restrict: 'E',
            transclude: true,
            templateUrl: 'dropdown.tmpl.html',
            scope: {
                dropdownTitle: '=',
                dropdownClass: '@'
            },
            link: function(scope, element, attrs) {

                // setup dropdownEl
                var dropdownEl = angular.element(element.children()[0]);
                dropdownEl.find('button').addClass(scope.dropdownClass);

        
                scope.toggleSelect = function() {
                    if(dropdownEl.hasClass('open')) {
                        dropdownEl.removeClass('open');
                        $document.unbind('click', clickHandler);
                    }
                    else {
                        dropdownEl.addClass('open');
                        $document.bind('click', clickHandler);
                    }
                }

                function clickHandler(event) {
                    if (elementMatchesAnyInArray(event.target, element.find(event.target.tagName)))
                        return;
                    dropdownEl.removeClass('open');
                    $document.unbind('click', clickHandler);
                    scope.$apply();
                }

                var elementMatchesAnyInArray = function (element, elementArray) {
                    for (var i = 0; i < elementArray.length; i++)
                        if (element == elementArray[i])
                            return true;
                    return false;
                }
        
            }
        }
    }
]);

angular.module('dropdown.tmpl.html', []).run(['$templateCache', function($templateCache) {
    $templateCache.put('dropdown.tmpl.html',

        "<div class=\"dropdown\">\n" +
        "   <button ng-click=\"toggleSelect()\">\n" +
        "       <span >{{dropdownTitle}}</span>\n" +
        "       <span class=\"caret\"></span>\n" +
        "   </button>\n" +
        "   <div class=\"dropdown-menu\" ng-transclude></div>\n" +
        "</div>\n");
}])
{'fraction_non_alphanumeric': 0.1414776555131372, 'fraction_numerical': 0.0008982708286548395, 'mean_word_length': 1.355367530407192, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 23, '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': '2985922', 'n_tokens_mistral': 1138, 'n_tokens_neox': 1072, 'n_words': 164}