Commit 5652b3aa authored by Mike Greiling's avatar Mike Greiling

Merge branch 'set-tooltip-default-boundary' into 'master'

Set tooltips to have default boundary viewport

Closes #47518

See merge request gitlab-org/gitlab-ce!19561
parents 1c17aafa ebf5f31d
...@@ -69,9 +69,10 @@ export default () => { ...@@ -69,9 +69,10 @@ export default () => {
gl.diffNotesCompileComponents(); gl.diffNotesCompileComponents();
if (!hasVueMRDiscussionsCookie()) { const resolveCountAppEl = document.querySelector('#resolve-count-app');
if (!hasVueMRDiscussionsCookie() && resolveCountAppEl) {
new Vue({ new Vue({
el: '#resolve-count-app', el: resolveCountAppEl,
components: { components: {
'resolve-count': ResolveCount 'resolve-count': ResolveCount
}, },
......
...@@ -144,6 +144,7 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -144,6 +144,7 @@ document.addEventListener('DOMContentLoaded', () => {
$body.tooltip({ $body.tooltip({
selector: '.has-tooltip, [data-toggle="tooltip"]', selector: '.has-tooltip, [data-toggle="tooltip"]',
trigger: 'hover', trigger: 'hover',
boundary: 'viewport',
placement(tip, el) { placement(tip, el) {
return $(el).data('placement') || 'bottom'; return $(el).data('placement') || 'bottom';
}, },
......
require 'spec_helper' require 'spec_helper'
shared_examples 'reportable note' do |type| shared_examples 'reportable note' do |type|
include MobileHelpers
include NotesHelper include NotesHelper
let(:comment) { find("##{ActionView::RecordIdentifier.dom_id(note)}") } let(:comment) { find("##{ActionView::RecordIdentifier.dom_id(note)}") }
...@@ -39,6 +40,9 @@ shared_examples 'reportable note' do |type| ...@@ -39,6 +40,9 @@ shared_examples 'reportable note' do |type|
end end
def open_dropdown(dropdown) def open_dropdown(dropdown)
# make window wide enough that tooltip doesn't trigger horizontal scrollbar
resize_window(1200, 800)
dropdown.find('.more-actions-toggle').click dropdown.find('.more-actions-toggle').click
dropdown.find('.dropdown-menu li', match: :first) dropdown.find('.dropdown-menu li', match: :first)
end end
......
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