<commit_before>'use strict';

angular.module('arethusa.core').directive('sidepanelFolder', [
  'sidepanel',
  function(sidepanel) {
    return {
      link: function (scope, element, attrs) {
        function addText() {
          var text = sidepanel.folded ? 'Show Panel' : 'Fold Panel';
          element.text(text);
        }

        element.on('click', function () {
          sidepanel.toggle();
          addText();
        });

        addText();
      }
    };
  }
]);
<commit_msg>Use a watch on fold status in sidepanelFolder<commit_after>'use strict';

angular.module('arethusa.core').directive('sidepanelFolder', [
  'sidepanel',
  function(sidepanel) {
    return {
      scope: {},
      link: function (scope, element, attrs) {
        function addText() {
          var text = sidepanel.folded ? 'Show Panel' : 'Fold Panel';
          element.text(text);
        }

        element.on('click', function () {
          sidepanel.toggle();
          addText();
        });

        scope.sp = sidepanel;

        scope.$watch('sp.folded', function(newVal, oldVal) {
          addText();
        });
      }
    };
  }
]);

{'fraction_non_alphanumeric': 0.1521547933157432, 'fraction_numerical': 0.0, 'mean_word_length': 2.075675675675676, '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': '2762041', 'n_tokens_mistral': 340, 'n_tokens_neox': 334, 'n_words': 65}