summaryrefslogtreecommitdiff
path: root/vendor/assets/javascripts
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-06-07 16:49:36 +0200
committerRémy Coutable <remy@rymai.me>2017-06-09 17:21:39 +0200
commitda3ad00cf15aa5d3c3724b412d56a0cba3a270b5 (patch)
tree0f71eedd2ae4c7378076b347f4401349426c6059 /vendor/assets/javascripts
parent47054451da0a3aa80cae02c8a096338c23be7b9b (diff)
downloadgitlab-ce-da3ad00cf15aa5d3c3724b412d56a0cba3a270b5.tar.gz
Replace Tipsy by Bootstrap's tooltips
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'vendor/assets/javascripts')
-rw-r--r--vendor/assets/javascripts/peek.js13
-rw-r--r--vendor/assets/javascripts/peek.performance_bar.js27
2 files changed, 10 insertions, 30 deletions
diff --git a/vendor/assets/javascripts/peek.js b/vendor/assets/javascripts/peek.js
index 6a4da020b9d..51d797ffd12 100644
--- a/vendor/assets/javascripts/peek.js
+++ b/vendor/assets/javascripts/peek.js
@@ -3,7 +3,7 @@ var requestId;
requestId = null;
(function($) {
- var fetchRequestResults, getRequestId, initializeTipsy, peekEnabled, toggleBar, updatePerformanceBar;
+ var fetchRequestResults, getRequestId, peekEnabled, toggleBar, updatePerformanceBar;
getRequestId = function() {
if (requestId != null) {
return requestId;
@@ -42,16 +42,6 @@ requestId = null;
}
return $(document).trigger('peek:render', [getRequestId(), results]);
};
- initializeTipsy = function() {
- return $('#peek .peek-tooltip, #peek .tooltip').each(function() {
- var el, gravity;
- el = $(this);
- gravity = el.hasClass('rightwards') || el.hasClass('leftwards') ? $.fn.tipsy.autoWE : $.fn.tipsy.autoNS;
- return el.tipsy({
- gravity: gravity
- });
- });
- };
toggleBar = function(event) {
var wrapper;
if ($(event.target).is(':input')) {
@@ -80,7 +70,6 @@ requestId = null;
});
};
$(document).on('keypress', toggleBar);
- $(document).on('peek:update', initializeTipsy);
$(document).on('peek:update', fetchRequestResults);
$(document).on('pjax:end', function(event, xhr, options) {
if (xhr != null) {
diff --git a/vendor/assets/javascripts/peek.performance_bar.js b/vendor/assets/javascripts/peek.performance_bar.js
index 3318e218890..6ed86dce2f2 100644
--- a/vendor/assets/javascripts/peek.performance_bar.js
+++ b/vendor/assets/javascripts/peek.performance_bar.js
@@ -85,17 +85,15 @@ PerformanceBar = (function() {
width = this.mapH(time);
title = name + ": " + (PerformanceBar.formatTime(time));
bar = $('<li></li>', {
- title: title,
- "class": 'peek-tooltip'
+ 'data-title': title,
+ 'data-toggle': 'tooltip',
+ 'data-container': 'body'
});
bar.css({
width: width + "px",
left: left + "px",
background: color
});
- bar.tipsy({
- gravity: $.fn.tipsy.autoNS
- });
return this.el.append(bar);
};
@@ -114,12 +112,10 @@ renderPerformanceBar = function() {
bar = new PerformanceBar;
bar.render(time);
span = $('<span>', {
- 'class': 'peek-tooltip',
- title: 'Total navigation time for this page.'
+ 'data-toggle': 'tooltip',
+ 'data-title': 'Total navigation time for this page.',
+ 'data-container': 'body'
}).text(PerformanceBar.formatTime(bar.total()));
- span.tipsy({
- gravity: $.fn.tipsy.autoNS
- });
return updateStatus(span);
};
@@ -168,12 +164,10 @@ $(document).on('pjax:end page:load turbolinks:load', function(event, xhr) {
tech = 'Turbolinks';
}
span = $('<span>', {
- 'class': 'peek-tooltip',
- title: tech + " navigation time"
+ 'data-toggle': 'tooltip',
+ 'data-title': tech + " navigation time",
+ 'data-container': 'body'
}).text(PerformanceBar.formatTime(total));
- span.tipsy({
- gravity: $.fn.tipsy.autoNS
- });
updateStatus(span);
return ajaxStart = null;
}, 0);
@@ -186,6 +180,3 @@ $(function() {
return $('#peek-view-performance-bar').remove();
}
});
-
-// ---
-// generated by coffee-script 1.9.2