
$(function() {
  var $deleteTaskModal = $('.modal.confirm-delete-task'),
      $deleteLink      = $deleteTaskModal.find('a.delete-link'),
      linkBase         = $deleteLink.data('base');

  $('.delete-task-button').click(function() {
    var taskId = $(this).data('task-id');
    $deleteLink.attr('href', linkBase + taskId + '?_s=' + csrfToken);
  });

  var $titleText = $('.sim-title-text'),
      $titleForm = $('.sim-title-form'),
      $toggleEditTitle = $('.toggle-edit-title')
  .click(function(event) {
    event.preventDefault();
    $titleText.toggleClass('hidden');
    $titleForm.toggleClass('hidden');
  });
});
