Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !6378
An error occurred while fetching the assigned milestone of the selected merge_request.

fixes tooltip insert problems

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/Yohn/patch-7 into 2.3.0-wip 12 years ago
  • Overview 0
  • Commits 8
  • Pipelines 0
  • Changes 4

Created by: Yohn

This adds a container option to the tooltip that can be called via html5 - data-container="body" or javascript - $().tooltip({container: 'body'})

if no container is given then it will get the default insertAfter() strategy

This fixes a number of bugs that were introduced when we changed the appendTo() to insertAfter()

If the tooltips are within a modal, and are inheriting its parents styles, then use $().tooltip({container: '#modalID'})

thanks to @WilliamStam and @blakeembrey for helping with this solution

some issues that noticed this bug #5687 (closed) #6254 (closed) #6314 (closed) #6283 (closed) #6275 (closed) #6250 (closed) #6240 (closed) #6236 (closed) along with a lot more..

this is another resubmit of this.. previous pull request - #6321 with some tweaks to work with the 2.3 branch.

Compare
  • 2.3.0-wip (base)

and
  • latest version
    340d9013
    8 commits, 2 years ago

4 files
+ 29
- 1

    Preferences

    File browser
    Compare changes
do‎cs‎
templat‎es/pages‎
javascrip‎t.mustache‎ +8 -0
javascr‎ipt.html‎ +8 -0
j‎s‎
tests‎/unit‎
bootstrap-‎tooltip.js‎ +10 -0
bootstrap-‎tooltip.js‎ +3 -1
docs/templates/pages/javascript.mustache
+ 8
- 0
  • View file @ 340d9013

  • Edit in single-file editor

  • Open in Web IDE


@@ -779,6 +779,14 @@ $('a[data-toggle="tab"]').on('shown', function (e) {
<p>{{_i}}Object structure is: <code>delay: { show: 500, hide: 100 }</code>{{/i}}</p>
</td>
</tr>
<tr>
<td>{{_i}}container{{/i}}</td>
<td>{{_i}}string | false{{/i}}</td>
<td>{{_i}}false{{/i}}</td>
<td>
<p>{{_i}}Appends the tooltip to a specific element <code>container: 'body'</code>{{/i}}</p>
</td>
</tr>
</tbody>
</table>
<div class="alert alert-info">
docs/javascript.html
+ 8
- 0
  • View file @ 340d9013

  • Edit in single-file editor

  • Open in Web IDE


@@ -849,6 +849,14 @@ $('a[data-toggle="tab"]').on('shown', function (e) {
<p>Object structure is: <code>delay: { show: 500, hide: 100 }</code></p>
</td>
</tr>
<tr>
<td>container</td>
<td>string | false</td>
<td>false</td>
<td>
<p>Appends the tooltip to a specific element <code>container: 'body'</code></p>
</td>
</tr>
</tbody>
</table>
<div class="alert alert-info">
js/tests/unit/bootstrap-tooltip.js
+ 10
- 0
  • View file @ 340d9013

  • Edit in single-file editor

  • Open in Web IDE


@@ -164,4 +164,14 @@ $(function () {
.tooltip('toggle')
ok($(".tooltip").is('.fade.in'), 'tooltip should be toggled in')
})
test("should place tooltips inside the body", function () {
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
.appendTo('#qunit-fixture')
.tooltip({container:'body'})
.tooltip('show')
ok($("body > .tooltip").length, 'inside the body')
ok(!$("#qunit-fixture > .tooltip").length, 'not found in parent')
tooltip.tooltip('hide')
})
})
js/bootstrap-tooltip.js
+ 3
- 1
  • View file @ 340d9013

  • Edit in single-file editor

  • Open in Web IDE


@@ -126,7 +126,8 @@
$tip
.detach()
.css({ top: 0, left: 0, display: 'block' })
.insertAfter(this.$element)
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
pos = this.getPosition()
@@ -279,6 +280,7 @@
, title: ''
, delay: 0
, html: false
, container: false
}
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference:
Source branch: github/fork/Yohn/patch-7

Menu

Explore Projects Groups Snippets