diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2018-04-17 10:36:18 -0500 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2018-04-17 10:36:18 -0500 |
commit | bb3d3e54265e0192661fb54f708342341b9bbd2d (patch) | |
tree | d7864ec70e5a1f8f7e4281ca0427e9f5b09d49fe /app | |
parent | ceb9f767db4dde2221dbb31ff8c8aa52a980fce2 (diff) | |
download | gitlab-ce-bb3d3e54265e0192661fb54f708342341b9bbd2d.tar.gz |
Fix tooltips
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/commons/bootstrap.js | 15 | ||||
-rw-r--r-- | app/assets/javascripts/main.js | 1 | ||||
-rw-r--r-- | app/helpers/ci_status_helper.rb | 8 |
3 files changed, 10 insertions, 14 deletions
diff --git a/app/assets/javascripts/commons/bootstrap.js b/app/assets/javascripts/commons/bootstrap.js index db96da4ccba..114a3cb872a 100644 --- a/app/assets/javascripts/commons/bootstrap.js +++ b/app/assets/javascripts/commons/bootstrap.js @@ -1,18 +1,15 @@ import $ from 'jquery'; +import Popper from 'popper.js/dist/umd/popper'; + // bootstrap jQuery plugins -import 'bootstrap-sass/assets/javascripts/bootstrap/affix'; -import 'bootstrap-sass/assets/javascripts/bootstrap/alert'; -import 'bootstrap-sass/assets/javascripts/bootstrap/button'; -import 'bootstrap-sass/assets/javascripts/bootstrap/dropdown'; -import 'bootstrap-sass/assets/javascripts/bootstrap/modal'; -import 'bootstrap-sass/assets/javascripts/bootstrap/tab'; -import 'bootstrap-sass/assets/javascripts/bootstrap/transition'; -import 'bootstrap-sass/assets/javascripts/bootstrap/tooltip'; -import 'bootstrap-sass/assets/javascripts/bootstrap/popover'; +import 'bootstrap/dist/js/bootstrap.bundle'; // custom jQuery functions $.fn.extend({ disable() { return $(this).prop('disabled', true).addClass('disabled'); }, enable() { return $(this).prop('disabled', false).removeClass('disabled'); }, }); + +// Enable Bootstrap tooltips +$('[data-toggle="tooltip"]').tooltip(); diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index 2b7d8fdd8fc..5883a48128f 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -136,7 +136,6 @@ document.addEventListener('DOMContentLoaded', () => { }); // Initialize tooltips - $.fn.tooltip.Constructor.DEFAULTS.trigger = 'hover'; $body.tooltip({ selector: '.has-tooltip, [data-toggle="tooltip"]', placement(tip, el) { diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index f0afcac5986..5fce97164ae 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -92,7 +92,7 @@ module CiStatusHelper "pipeline-status/#{pipeline_status.sha}-#{pipeline_status.status}" end - def render_project_pipeline_status(pipeline_status, tooltip_placement: 'auto left') + def render_project_pipeline_status(pipeline_status, tooltip_placement: 'left') project = pipeline_status.project path = pipelines_project_commit_path(project, pipeline_status.sha, ref: pipeline_status.ref) @@ -103,7 +103,7 @@ module CiStatusHelper tooltip_placement: tooltip_placement) end - def render_commit_status(commit, ref: nil, tooltip_placement: 'auto left') + def render_commit_status(commit, ref: nil, tooltip_placement: 'left') project = commit.project path = pipelines_project_commit_path(project, commit, ref: ref) @@ -114,7 +114,7 @@ module CiStatusHelper tooltip_placement: tooltip_placement) end - def render_pipeline_status(pipeline, tooltip_placement: 'auto left') + def render_pipeline_status(pipeline, tooltip_placement: 'left') project = pipeline.project path = project_pipeline_path(project, pipeline) render_status_with_link('pipeline', pipeline.status, path, tooltip_placement: tooltip_placement) @@ -125,7 +125,7 @@ module CiStatusHelper Ci::Runner.shared.blank? end - def render_status_with_link(type, status, path = nil, tooltip_placement: 'auto left', cssclass: '', container: 'body') + def render_status_with_link(type, status, path = nil, tooltip_placement: 'left', cssclass: '', container: 'body') klass = "ci-status-link ci-status-icon-#{status.dasherize} #{cssclass}" title = "#{type.titleize}: #{ci_label_for_status(status)}" data = { toggle: 'tooltip', placement: tooltip_placement, container: container } |