<commit_before>'use strict';

angular.module('arethusaTranslateGuiApp').directive('containers', [
  '$timeout',
  function($timeout) {
   return {
     restrict: 'A',
     scope: true,
     link: function(scope, element) {
       scope.$watch('showIndex', function(newVal) {
         if (newVal) {
           scope.itemClass = 'small-12';
           scope.containerClass = 'small-9 large-10';
         } else {
           scope.containerClass = 'small-12';
           scope.itemClass = 'small-6';
         }
         scope.cloak = true;
         $timeout(function() {
           scope.cloak = false;
         }, 600);
       });
     },
     templateUrl: 'app/i18n/containers.directive.html'
   };
  }
]);
<commit_msg>Listen to scroll event in containers directive<commit_after>'use strict';

angular.module('arethusaTranslateGuiApp').directive('containers', [
  '$timeout',
  function($timeout) {
   return {
     restrict: 'A',
     scope: true,
     link: function(scope, element) {
       scope.$watch('showIndex', function(newVal) {
         if (newVal) {
           scope.itemClass = 'small-12';
           scope.containerClass = 'small-9 large-10';
         } else {
           scope.containerClass = 'small-12';
           scope.itemClass = 'small-6';
         }
         scope.cloak = true;
         $timeout(function() {
           scope.cloak = false;
         }, 600);
       });

       function autoScroll(ev, item) {
         console.log('Scrolling!', item);
         element.scrollTo(item, 0, 500);
       }

       scope.$on('scrollToItem', autoScroll);
     },
     templateUrl: 'app/i18n/containers.directive.html'
   };
  }
]);

{'fraction_non_alphanumeric': 0.14987864077669902, 'fraction_numerical': 0.01820388349514563, 'mean_word_length': 2.0822429906542057, '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': '4214571', 'n_tokens_mistral': 524, 'n_tokens_neox': 498, 'n_words': 86}