summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Ho <clemmakesapps@gmail.com>2018-06-08 04:27:36 +0000
committerMike Greiling <mike@pixelcog.com>2018-06-08 04:27:36 +0000
commitebf5f31d8c7e3381c16899ba8e64e569d3dfd3a3 (patch)
tree8ac9620e23dac2af3adb0b61eea992f7e58475ed
parent1c17aafa765510e92d9957d4cb655f46dffe4f03 (diff)
downloadgitlab-ce-ebf5f31d8c7e3381c16899ba8e64e569d3dfd3a3.tar.gz
Set tooltips to have default boundary viewport
-rw-r--r--app/assets/javascripts/diff_notes/diff_notes_bundle.js5
-rw-r--r--app/assets/javascripts/main.js1
-rw-r--r--spec/support/features/reportable_note_shared_examples.rb4
3 files changed, 8 insertions, 2 deletions
diff --git a/app/assets/javascripts/diff_notes/diff_notes_bundle.js b/app/assets/javascripts/diff_notes/diff_notes_bundle.js
index e17daec6a92..d5161ab7df9 100644
--- a/app/assets/javascripts/diff_notes/diff_notes_bundle.js
+++ b/app/assets/javascripts/diff_notes/diff_notes_bundle.js
@@ -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
},
diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js
index 9803bebfd10..c9ce838cd48 100644
--- a/app/assets/javascripts/main.js
+++ b/app/assets/javascripts/main.js
@@ -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';
},
diff --git a/spec/support/features/reportable_note_shared_examples.rb b/spec/support/features/reportable_note_shared_examples.rb
index 836e5e7be23..b4c71d69119 100644
--- a/spec/support/features/reportable_note_shared_examples.rb
+++ b/spec/support/features/reportable_note_shared_examples.rb
@@ -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