Commit 641febac authored by James Lopez's avatar James Lopez

fix JS - now tooltip and flash should show

parent f3d03af4
...@@ -89,9 +89,9 @@ ...@@ -89,9 +89,9 @@
= link_to "#", class: 'btn js-toggle-button import_git' do = link_to "#", class: 'btn js-toggle-button import_git' do
%i.fa.fa-git %i.fa.fa-git
%span Repo by URL %span Repo by URL
%div %div{ class: 'import_gitlab_project' }
- if gitlab_project_import_enabled? - if gitlab_project_import_enabled?
= link_to new_import_gitlab_project_path, class: 'btn import_gitlab_project project-submit' do = link_to new_import_gitlab_project_path, class: 'btn btn_import_gitlab_project project-submit' do
%i.fa.fa-gitlab %i.fa.fa-gitlab
%span GitLab export %span GitLab export
...@@ -130,16 +130,16 @@ ...@@ -130,16 +130,16 @@
$(".modal").hide(); $(".modal").hide();
}); });
$('.import_gitlab_project').bind('click', function() { $('.btn_import_gitlab_project').bind('click', function() {
var _href = $("a.import_gitlab_project").attr("href"); var _href = $("a.btn_import_gitlab_project").attr("href");
$(".import_gitlab_project").attr("href", _href + '?namespace_id=' + $("#project_namespace_id").val() + '&path=' + $("#project_path").val()); $(".btn_import_gitlab_project").attr("href", _href + '?namespace_id=' + $("#project_namespace_id").val() + '&path=' + $("#project_path").val());
}); });
$('.import_gitlab_project').attr('disabled',true) $('.btn_import_gitlab_project').attr('disabled',true)
$('.import_gitlab_project').attr('title', 'Project path required.'); $('.import_gitlab_project').attr('title', 'Project path required.');
$('.import_gitlab_project').click(function( event ) { $('.import_gitlab_project').click(function( event ) {
if($('.import_gitlab_project').attr('disabled')) { if($('.btn_import_gitlab_project').attr('disabled')) {
event.preventDefault(); event.preventDefault();
new Flash("Please enter a path for the project to be imported to."); new Flash("Please enter a path for the project to be imported to.");
} }
...@@ -147,11 +147,11 @@ ...@@ -147,11 +147,11 @@
$('#project_path').keyup(function(){ $('#project_path').keyup(function(){
if($(this).val().length !=0) { if($(this).val().length !=0) {
$('.import_gitlab_project').attr('disabled', false); $('.btn_import_gitlab_project').attr('disabled', false);
$('.import_gitlab_project').attr('title',''); $('.import_gitlab_project').attr('title','');
$(".flash-container").html("") $(".flash-container").html("")
} else { } else {
$('.import_gitlab_project').attr('disabled',true); $('.btn_import_gitlab_project').attr('disabled',true);
$('.import_gitlab_project').attr('title', 'Project path required.'); $('.import_gitlab_project').attr('title', 'Project path required.');
} }
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment