<commit_before>/*global angular*/
(function () {
    'use strict';

    // min-font-size attribute = minimum font size in pixels
    // max-font-size attribute = maximum font size in pixels
    // Directive must be used on the parent of an element with the .text-fill class
    angular.module('core').directive('textFill', ["$timeout", function ($timeout) {
        return {
            link: function postLink(scope, element, attrs) {
                if ($(element).find('.text-fill').length === 0) {
                    return;
                }

                var minFontSize = parseFloat(attrs.minFontSize);
                var maxFontSize = parseFloat(attrs.maxFontSize);

                if (!minFontSize || !maxFontSize) {
                    return;
                }

                var applyTextFill = function() {
                    $(element).textfill({
                        minFontPixels: minFontSize,
                        maxFontPixels: maxFontSize,
                        innerTag: '.text-fill'
                    });
                }

                scope.$on('updateSlideContentPart', function (event, content, member, slidePartId) {
                    if (member === attrs.member) {
                        applyTextFill();
                    }
                });

                $timeout(applyTextFill, 100, false);
            }
        };
    }]);
}());<commit_msg>Apply textFill on field edit after the DOM is ready.<commit_after>/*global angular*/
(function () {
    'use strict';

    // min-font-size attribute = minimum font size in pixels
    // max-font-size attribute = maximum font size in pixels
    // Directive must be used on the parent of an element with the .text-fill class
    angular.module('core').directive('textFill', ["$timeout", function ($timeout) {
        return {
            link: function postLink(scope, element, attrs) {
                if ($(element).find('.text-fill').length === 0) {
                    return;
                }

                var minFontSize = parseFloat(attrs.minFontSize);
                var maxFontSize = parseFloat(attrs.maxFontSize);

                if (!minFontSize || !maxFontSize) {
                    return;
                }

                var applyTextFill = function() {
                    $(element).textfill({
                        minFontPixels: minFontSize,
                        maxFontPixels: maxFontSize,
                        innerTag: '.text-fill'
                    });
                }

                scope.$on('updateSlideContentPart', function (event, content, member, slidePartId) {
                    if (member === attrs.member) {
                        $timeout(applyTextFill, 100, false);
                    }
                });

                $timeout(applyTextFill, 100, false);
            }
        };
    }]);
}());
{'fraction_non_alphanumeric': 0.11231252179979072, 'fraction_numerical': 0.0038367631670735963, 'mean_word_length': 1.3682906688687035, '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': '2355486', 'n_tokens_mistral': 731, 'n_tokens_neox': 667, 'n_words': 171}