Fix project title validation, prevent clicking on disabled button
This commit is contained in:
parent
d4c99f644a
commit
576ffef6c1
1 changed files with 2 additions and 9 deletions
|
@ -123,23 +123,16 @@
|
|||
$(".btn_import_gitlab_project").attr("href", _href + '?namespace_id=' + $("#project_namespace_id").val() + '&path=' + $("#project_path").val());
|
||||
});
|
||||
|
||||
$('.btn_import_gitlab_project').attr('disabled',true)
|
||||
$('.btn_import_gitlab_project').attr('disabled', $('#project_path').val().trim().length === 0);
|
||||
$('.import_gitlab_project').attr('title', 'Project path and name required.');
|
||||
|
||||
$('.import_gitlab_project').click(function( event ) {
|
||||
if($('.btn_import_gitlab_project').attr('disabled')) {
|
||||
event.preventDefault();
|
||||
new Flash("Please enter path and name for the project to be imported to.");
|
||||
}
|
||||
});
|
||||
|
||||
$('#new_project').submit(function(){
|
||||
var $path = $('#project_path');
|
||||
$path.val($path.val().trim());
|
||||
});
|
||||
|
||||
$('#project_path').keyup(function(){
|
||||
if($(this).val().length !=0) {
|
||||
if($(this).val().trim().length !== 0) {
|
||||
$('.btn_import_gitlab_project').attr('disabled', false);
|
||||
$('.import_gitlab_project').attr('title','');
|
||||
$(".flash-container").html("")
|
||||
|
|
Loading…
Reference in a new issue