Commit e71a6c90 authored by Kushal Pandya's avatar Kushal Pandya

Show BS Tooltips on disabled GitLab export button

parent 2c26b9d1
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
- if git_import_enabled? - if git_import_enabled?
= link_to "#", class: 'btn js-toggle-button import_git' do = link_to "#", class: 'btn js-toggle-button import_git' do
= icon('git', text: 'Repo by URL') = icon('git', text: 'Repo by URL')
.import_gitlab_project .import_gitlab_project.has-tooltip{ data: { container: 'body' } }
- if gitlab_project_import_enabled? - if gitlab_project_import_enabled?
= link_to new_import_gitlab_project_path, class: 'btn btn_import_gitlab_project project-submit' do = link_to new_import_gitlab_project_path, class: 'btn btn_import_gitlab_project project-submit' do
= icon('gitlab', text: 'GitLab export') = icon('gitlab', text: 'GitLab export')
...@@ -110,6 +110,7 @@ ...@@ -110,6 +110,7 @@
:javascript :javascript
var importBtnTooltip = "Please enter a valid project name."; var importBtnTooltip = "Please enter a valid project name.";
var $importBtnWrapper = $('.import_gitlab_project');
$('.how_to_import_link').bind('click', function (e) { $('.how_to_import_link').bind('click', function (e) {
e.preventDefault(); e.preventDefault();
...@@ -126,7 +127,7 @@ ...@@ -126,7 +127,7 @@
}); });
$('.btn_import_gitlab_project').attr('disabled', $('#project_path').val().trim().length === 0); $('.btn_import_gitlab_project').attr('disabled', $('#project_path').val().trim().length === 0);
$('.import_gitlab_project').attr('title', importBtnTooltip); $importBtnWrapper.attr('title', importBtnTooltip);
$('#new_project').submit(function(){ $('#new_project').submit(function(){
var $path = $('#project_path'); var $path = $('#project_path');
...@@ -136,11 +137,11 @@ ...@@ -136,11 +137,11 @@
$('#project_path').keyup(function(){ $('#project_path').keyup(function(){
if($(this).val().trim().length !== 0) { if($(this).val().trim().length !== 0) {
$('.btn_import_gitlab_project').attr('disabled', false); $('.btn_import_gitlab_project').attr('disabled', false);
$('.import_gitlab_project').attr('title',''); $importBtnWrapper.attr('title','');
$(".flash-container").html("") $importBtnWrapper.removeClass('has-tooltip');
} else { } else {
$('.btn_import_gitlab_project').attr('disabled',true); $('.btn_import_gitlab_project').attr('disabled',true);
$('.import_gitlab_project').attr('title', importBtnTooltip); $importBtnWrapper.addClass('has-tooltip');
} }
}); });
......
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