<commit_before>angular.module('app.leagues.show', [])
.controller('showLeagueController', function ($scope, $stateParams, ShowLeague, $location, $window, $state) {
  $scope.league = {};
  $scope.events = [];
  $scope.characters = [];
  $scope.showEvents = false;
  $scope.showCharacters = false;
  $scope.indexUser;
  $scope.indexSelect;
  $scope.showTool = false;
  $scope.showUserRoster = true;
  $scope.charEventTrigger = {};

  $scope.returnUserRoster = ShowLeague.returnUserRoster;

  $scope.setCharacter = function() {
    $scope.charEventTrigger.characterId = this.character.id;
  }

  $scope.setEvent = function() {
    $scope.charEventTrigger.eventId = this.event.id;
  }

  var currentUserId = JSON.parse(localStorage.getItem('user')).id;

  $scope.isOwner = function() {
    if(currentUserId === $scope.league.owner) {
      return true;
    }
    return false;
  };

  $scope.triggerEvent = function() {
    ShowLeague.triggerEvent($scope.charEventTrigger, function() {

    });
  }

  $scope.toggleTool = function() {
    $scope.showTool = !$scope.showTool;
  };

  $scope.toggleEvents = function() {
    $scope.showEvents = !$scope.showEvents;
  };

  $scope.toggleCharacters = function() {
    $scope.showCharacters = !$scope.showCharacters;
  };
  // if roster exists
    // $scope.drafted = true
  // else 
    //$scope.drafted = false;

  $scope.showRoster = function(index, userId) {
    $scope.indexSelect = index;
  }<commit_msg>[Feature] clicking a user while their roster is open will cause it to close<commit_after>angular.module('app.leagues.show', [])
.controller('showLeagueController', function ($scope, $stateParams, ShowLeague, $location, $window, $state) {
  $scope.league = {};
  $scope.events = [];
  $scope.characters = [];
  $scope.showEvents = false;
  $scope.showCharacters = false;
  $scope.indexUser;
  $scope.indexSelect;
  $scope.showTool = false;
  $scope.showUserRoster = true;
  $scope.charEventTrigger = {};

  $scope.returnUserRoster = ShowLeague.returnUserRoster;

  $scope.setCharacter = function() {
    $scope.charEventTrigger.characterId = this.character.id;
  }

  $scope.setEvent = function() {
    $scope.charEventTrigger.eventId = this.event.id;
  }

  var currentUserId = JSON.parse(localStorage.getItem('user')).id;

  $scope.isOwner = function() {
    if(currentUserId === $scope.league.owner) {
      return true;
    }
    return false;
  };

  $scope.triggerEvent = function() {
    ShowLeague.triggerEvent($scope.charEventTrigger, function() {

    });
  }

  $scope.toggleTool = function() {
    $scope.showTool = !$scope.showTool;
  };

  $scope.toggleEvents = function() {
    $scope.showEvents = !$scope.showEvents;
  };

  $scope.toggleCharacters = function() {
    $scope.showCharacters = !$scope.showCharacters;
  };
  // if roster exists
    // $scope.drafted = true
  // else 
    //$scope.drafted = false;

  $scope.showRoster = function(index, userId) {
    //if that roster is already being displayed, close it
    if ($scope.indexSelect === index) {
      $scope.indexSelect = null;
    }
    else {
      //display roster of the user that was clicked
      $scope.indexSelect = index;
    }
  }
{'fraction_non_alphanumeric': 0.1526813880126183, 'fraction_numerical': 0.0, 'mean_word_length': 3.459915611814346, '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': '5518608', 'n_tokens_mistral': 1055, 'n_tokens_neox': 1021, 'n_words': 182}