From 8585ae61e730a48fc0688417b24279c48b59dada Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Thu, 28 Sep 2017 11:44:33 +0100 Subject: Fix fork button being disabled for users who can fork to group Previously the fork button was disabled for all users if they have exceeded their project limit. This fixes that by changing the check to see if the user can fork to a group instead of their own namespace. This behaviour is already possible by visiting the new fork page directly, so this just fixes the button being disabled. Closes #38462 --- app/assets/javascripts/project_fork.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'app/assets/javascripts/project_fork.js') diff --git a/app/assets/javascripts/project_fork.js b/app/assets/javascripts/project_fork.js index 47197db39d3..68cf47fd54e 100644 --- a/app/assets/javascripts/project_fork.js +++ b/app/assets/javascripts/project_fork.js @@ -1,13 +1,8 @@ -/* eslint-disable func-names, space-before-function-paren, wrap-iife, prefer-arrow-callback, max-len */ -(function() { - this.ProjectFork = (function() { - function ProjectFork() { - $('.fork-thumbnail a').on('click', function() { - $('.fork-namespaces').hide(); - return $('.save-project-loader').show(); - }); - } +export default () => { + $('.fork-thumbnail a').on('click', function forkThumbnailClicked() { + if ($(this).hasClass('disabled')) return false; - return ProjectFork; - })(); -}).call(window); + $('.fork-namespaces').hide(); + return $('.save-project-loader').show(); + }); +}; -- cgit v1.2.3