Codeminer42/cm42-central

View on GitHub
app/assets/javascripts/controllers/projects/EditController.js

Summary

Maintainability
A
0 mins
Test Coverage
import TagGroupsController from 'controllers/tag_groups/TagGroupsController';

export default () => {
  TagGroupsController();

  const nameConfirmation = $('#name_confirmation');
  const projectDeleteLink = $('#project-delete');

  nameConfirmation.keyup(() => {
    verifyProjectName();
  });

  function verifyProjectName() {
    if (nameConfirmation.data('project-name') === nameConfirmation.val()) {
      projectDeleteLink.removeAttr('disabled');
    } else {
      projectDeleteLink.attr('disabled', true);
    }
  }
};