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