/**
 * TeamController: Let the user change player names, when she clicks a player
 * name
 *
 * @return TeamController
 * @author Erik E. Lorenz <erik@tuvero.de>
 * @license MIT License
 * @see LICENSE
 */
define(["lib/extend", "ui/renamecontroller", "ui/toast", "ui/strings",
  "ui/state", "ui/tabshandle"
], function (extend, RenameController, Toast, Strings, State, TabsHandle) {

  function TeamController(view, $input) {
    TeamController.superconstructor.call(this, view);

    this.view.$view.find(".teamno").click(this.openModal.bind(this));
  }
  extend(TeamController, RenameController);

  TeamController.prototype.getPlayer = function ($name) {
    var index, $names;

    $names = this.view.$view.find(".name");
    if ($names.length === 0) {
      $names = this.view.$view.filter(".name");
    }
    index = $names.index($name);

    return this.model.getPlayer(index);
  };

  TeamController.prototype.getName = function () {
    var player;

    if (!this.$anchor) {
      return "";
    }

    player = this.getPlayer(this.$anchor);

    return player.getName();
  };

  TeamController.prototype.setName = function (name) {
    var player;

    if (!this.$anchor || !name) {
      return false;
    }

    player = this.getPlayer(this.$anchor);

    player.setName(name);

    return true;
  };

  TeamController.prototype.openModal = function () {
    State.focusedteam.set(this.model);

    TabsHandle.focus("team");
  };

  return TeamController;
});
@@ -1436,16 +1436,220 @@
 ;%0A  %7D;%0A%0A
+  TeamController.prototype.destroy = function () %7B%0A    if (State.focusedteam.get() === this.model) %7B%0A      State.focusedteam.set(undefined);%0A    %7D%0A%0A    TeamController.superclass.destroy.call(this);%0A  %7D;%0A%0A
   return

Add TeamController.prototype.destroy()