<commit_before>/**
 * @author <NAME>
 * @email <EMAIL>
 * @version 1.0.5
 * @license: MIT
 */
(function (angular) {
    'use strict';

    var ngSticky = ['$timeout', function ($timeout) {
        return {
            restrict: 'A',
            scope: {
                scrollingElem: '=?',
                superSticky: '=?',
                css: '=?'
            },
            link: function ($scope, element) {
                $timeout(function () {
                    var elem = angular.element(element),
                        clone = elem.clone().wrap('<div class="sticky-wrapper"></div>').parent(),
                        visible = false;

                    if ($scope.superSticky) {
                        clone.addClass('sticky-keep-visible');
                    }
                    clone.addClass($scope.css);

                    clone.css('display', 'none');
                    elem.parent().append(clone);

                    var scrolling = $scope.scrollingElem || document;
                    angular.element(scrolling).on('scroll', function () {
                        var offsetTop = elem[0].getBoundingClientRect().top;
                        var offsetKeepVisible = 0;
                        angular.forEach(angular.element(document.querySelector('.sticky-wrapper.sticky-keep-visible')), function (elem) {
                            var jThis = angular.element(elem);
                            if (jThis !== clone && jThis[0].offsetWidth > 0 && jThis[0].offsetHeight > 0) {
                                offsetKeepVisible += jThis[0].offsetHeight;
                            }
                        });

                        if (offsetTop <= offsetKeepVisible) {
                            if (!visible) {
                                angular.element(document.querySelector('.sticky-wrapper:not(.sticky-keep-visible')).css('display', 'none');
                                clone.css('top', offsetKeepVisible + 'px');
                                clone.css('display', 'block');
                                visible = true;
                            }
                        } else {
                            clone.css('display', 'none');
                            visible = false;
                        }
                    });
                });
            }
        };
    }];


    angular.module('ngSticky', [])
        .directive('ngSticky', ngSticky);

})(window.angular);<commit_msg>fix query selector<commit_after>/**
 * @author <NAME>
 * @email <EMAIL>
 * @version 1.0.5
 * @license: MIT
 */
(function (angular) {
    'use strict';

    var ngSticky = ['$timeout', function ($timeout) {
        return {
            restrict: 'A',
            scope: {
                scrollingElem: '=?',
                superSticky: '=?',
                css: '=?'
            },
            link: function ($scope, element) {
                $timeout(function () {
                    var elem = angular.element(element),
                        clone = elem.clone().wrap('<div class="sticky-wrapper"></div>').parent(),
                        visible = false;

                    if ($scope.superSticky) {
                        clone.addClass('sticky-keep-visible');
                    }
                    clone.addClass($scope.css);

                    clone.css('display', 'none');
                    elem.parent().append(clone);

                    var scrolling = $scope.scrollingElem || document;
                    angular.element(scrolling).on('scroll', function () {
                        var offsetTop = elem[0].getBoundingClientRect().top;
                        var offsetKeepVisible = 0;
                        angular.forEach(angular.element(document.querySelectorAll('.sticky-wrapper.sticky-keep-visible')), function (elem) {
                            var jThis = angular.element(elem);
                            if (jThis !== clone && jThis[0].offsetWidth > 0 && jThis[0].offsetHeight > 0) {
                                offsetKeepVisible += jThis[0].offsetHeight;
                            }
                        });

                        if (offsetTop <= offsetKeepVisible) {
                            if (!visible) {
                                angular.element(document.querySelectorAll('.sticky-wrapper:not(.sticky-keep-visible')).css('display', 'none');
                                clone.css('top', offsetKeepVisible + 'px');
                                clone.css('display', 'block');
                                visible = true;
                            }
                        } else {
                            clone.css('display', 'none');
                            visible = false;
                        }
                    });
                });
            }
        };
    }];


    angular.module('ngSticky', [])
        .directive('ngSticky', ngSticky);

})(window.angular);
{'fraction_non_alphanumeric': 0.13106106715358085, 'fraction_numerical': 0.004057618178129438, 'mean_word_length': 1.1077383497221034, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, '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': '3900869', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1122, 'n_words': 191}