Set tooltips to have default boundary viewport

This commit is contained in:
Clement Ho 2018-06-08 04:27:36 +00:00 committed by Mike Greiling
parent 1c17aafa76
commit ebf5f31d8c
3 changed files with 8 additions and 2 deletions

View File

@ -69,9 +69,10 @@ export default () => {
gl.diffNotesCompileComponents();
if (!hasVueMRDiscussionsCookie()) {
const resolveCountAppEl = document.querySelector('#resolve-count-app');
if (!hasVueMRDiscussionsCookie() && resolveCountAppEl) {
new Vue({
el: '#resolve-count-app',
el: resolveCountAppEl,
components: {
'resolve-count': ResolveCount
},

View File

@ -144,6 +144,7 @@ document.addEventListener('DOMContentLoaded', () => {
$body.tooltip({
selector: '.has-tooltip, [data-toggle="tooltip"]',
trigger: 'hover',
boundary: 'viewport',
placement(tip, el) {
return $(el).data('placement') || 'bottom';
},

View File

@ -1,6 +1,7 @@
require 'spec_helper'
shared_examples 'reportable note' do |type|
include MobileHelpers
include NotesHelper
let(:comment) { find("##{ActionView::RecordIdentifier.dom_id(note)}") }
@ -39,6 +40,9 @@ shared_examples 'reportable note' do |type|
end
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('.dropdown-menu li', match: :first)
end