<commit_before>'use strict';

/*
 * Subject directive
 * Creates the possibility to use a <subject> element,
 * which will be replaced with the contents of template/subject.html
 * Additionally a subject directive uses it's own scope which is needed,
 * so that each subject can hold it's own property list
 */

angular.module('GSB.directives.subject', [])

  .directive('subjectDir', function () {
    return {
      restrict: "E",
      replace: true,
      templateUrl: 'template/subject.html',
      link: function (scope, element, attrs) {

        // Set watch for change of the highlightedSubject
        scope.$watch('highlightedSubject', function () {

          //If the highlightedSubject has the same alias as the current subject, highlight it, else not
          if (scope.highlightedSubject !== undefined && scope.highlightedSubject !== null &&
            scope.hasOwnProperty("subjectInst") && scope.highlightedSubject.hasOwnProperty("alias") &&
            scope.highlightedSubject.hasOwnProperty("alias") &&
            scope.highlightedSubject.alias == scope.subjectInst.alias) {
            element.addClass("highlightSubject");
          } else {
            element.removeClass("highlightSubject");
          }
        });

        elem.on("mouseenter",function(){
          scope.subjectInst.showAdditionalFields = true;
          scope.$apply();
        });

        elem.on("mouseleave",function(){
          scope.subjectInst.showAdditionalFields = false;
          scope.$apply();
        });
      }
    };
  });<commit_msg>Fixed bug.<commit_after>'use strict';

/*
 * Subject directive
 * Creates the possibility to use a <subject> element,
 * which will be replaced with the contents of template/subject.html
 * Additionally a subject directive uses it's own scope which is needed,
 * so that each subject can hold it's own property list
 */

angular.module('GSB.directives.subject', [])

  .directive('subjectDir', function () {
    return {
      restrict: "E",
      replace: true,
      templateUrl: 'template/subject.html',
      link: function (scope, element, attrs) {

        // Set watch for change of the highlightedSubject
        scope.$watch('highlightedSubject', function () {

          //If the highlightedSubject has the same alias as the current subject, highlight it, else not
          if (scope.highlightedSubject !== undefined && scope.highlightedSubject !== null &&
            scope.hasOwnProperty("subjectInst") && scope.highlightedSubject.hasOwnProperty("alias") &&
            scope.highlightedSubject.hasOwnProperty("alias") &&
            scope.highlightedSubject.alias == scope.subjectInst.alias) {
            element.addClass("highlightSubject");
          } else {
            element.removeClass("highlightSubject");
          }
        });

        element.on("mouseenter",function(){
          scope.subjectInst.showAdditionalFields = true;
          scope.$apply();
        });

        element.on("mouseleave",function(){
          scope.subjectInst.showAdditionalFields = false;
          scope.$apply();
        });
      }
    };
  });
{'fraction_non_alphanumeric': 0.11812037335049887, 'fraction_numerical': 0.0, 'mean_word_length': 2.6607773851590104, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '787981', 'n_tokens_mistral': 780, 'n_tokens_neox': 753, 'n_words': 205}