Convert fixTitle to _fixTitle for regenerating tooltip titles

This commit is contained in:
Clement Ho 2018-04-19 10:40:23 -05:00
parent a3bc692e59
commit 1536c69f6a
13 changed files with 16 additions and 16 deletions

View File

@ -392,7 +392,7 @@ class AwardsHandler {
.removeAttr('data-title') .removeAttr('data-title')
.removeAttr('data-original-title') .removeAttr('data-original-title')
.attr('title', this.toSentence(authors)) .attr('title', this.toSentence(authors))
.tooltip('fixTitle'); .tooltip('_fixTitle');
} }
addYouToUserList(votesBlock, emoji) { addYouToUserList(votesBlock, emoji) {
@ -405,7 +405,7 @@ class AwardsHandler {
users.unshift('You'); users.unshift('You');
return awardBlock return awardBlock
.attr('title', this.toSentence(users)) .attr('title', this.toSentence(users))
.tooltip('fixTitle'); .tooltip('_fixTitle');
} }
createAwardButtonForVotesBlock(votesBlock, emojiName) { createAwardButtonForVotesBlock(votesBlock, emojiName) {

View File

@ -8,10 +8,10 @@ function showTooltip(target, title) {
if (!$target.data('hideTooltip')) { if (!$target.data('hideTooltip')) {
$target $target
.attr('title', title) .attr('title', title)
.tooltip('fixTitle') .tooltip('_fixTitle')
.tooltip('show') .tooltip('show')
.attr('title', originalTitle) .attr('title', originalTitle)
.tooltip('fixTitle'); .tooltip('_fixTitle');
} }
} }

View File

@ -116,7 +116,7 @@ export default class BlobViewer {
this.copySourceBtn.classList.add('disabled'); this.copySourceBtn.classList.add('disabled');
} }
$(this.copySourceBtn).tooltip('fixTitle'); $(this.copySourceBtn).tooltip('_fixTitle');
} }
switchToViewer(name) { switchToViewer(name) {

View File

@ -57,7 +57,7 @@ export default function initCompareAutocomplete() {
$dropdownContainer.on('click', '.dropdown-content a', (e) => { $dropdownContainer.on('click', '.dropdown-content a', (e) => {
$dropdown.prop('title', e.target.text.replace(/_+?/g, '-')); $dropdown.prop('title', e.target.text.replace(/_+?/g, '-'));
if ($dropdown.hasClass('has-tooltip')) { if ($dropdown.hasClass('has-tooltip')) {
$dropdown.tooltip('fixTitle'); $dropdown.tooltip('_fixTitle');
} }
}); });
}); });

View File

@ -79,7 +79,7 @@ const DiffNoteAvatars = Vue.extend({
storeState: { storeState: {
handler() { handler() {
this.$nextTick(() => { this.$nextTick(() => {
$('.has-tooltip', this.$el).tooltip('fixTitle'); $('.has-tooltip', this.$el).tooltip('_fixTitle');
// We need to add/remove a class to an element that is outside the Vue instance // We need to add/remove a class to an element that is outside the Vue instance
this.addNoCommentClass(); this.addNoCommentClass();
@ -138,7 +138,7 @@ const DiffNoteAvatars = Vue.extend({
this.$nextTick(() => { this.$nextTick(() => {
this.setDiscussionVisible(); this.setDiscussionVisible();
$('.has-tooltip', this.$el).tooltip('fixTitle'); $('.has-tooltip', this.$el).tooltip('_fixTitle');
$('.has-tooltip', this.$el).tooltip('hide'); $('.has-tooltip', this.$el).tooltip('hide');
}); });
}, },

View File

@ -61,7 +61,7 @@ const ResolveBtn = Vue.extend({
this.$nextTick(() => { this.$nextTick(() => {
$(this.$refs.button) $(this.$refs.button)
.tooltip('hide') .tooltip('hide')
.tooltip('fixTitle'); .tooltip('_fixTitle');
}); });
}, },
resolve: function () { resolve: function () {

View File

@ -121,7 +121,7 @@ export default class LabelsSelect {
$sidebarLabelTooltip $sidebarLabelTooltip
.attr('title', labelTooltipTitle) .attr('title', labelTooltipTitle)
.tooltip('fixTitle'); .tooltip('_fixTitle');
$('.has-tooltip', $value).tooltip({ $('.has-tooltip', $value).tooltip({
container: 'body' container: 'body'

View File

@ -51,7 +51,7 @@ export const rstrip = (val) => {
return val; return val;
}; };
export const updateTooltipTitle = ($tooltipEl, newTitle) => $tooltipEl.attr('title', newTitle).tooltip('fixTitle'); export const updateTooltipTitle = ($tooltipEl, newTitle) => $tooltipEl.attr('title', newTitle).tooltip('_fixTitle');
export const disableButtonIfEmptyField = (fieldSelector, buttonSelector, eventName = 'input') => { export const disableButtonIfEmptyField = (fieldSelector, buttonSelector, eventName = 'input') => {
const field = $(fieldSelector); const field = $(fieldSelector);

View File

@ -42,7 +42,7 @@ export default class ProjectLabelSubscription {
const $button = $(button); const $button = $(button);
if ($button.attr('data-original-title')) { if ($button.attr('data-original-title')) {
$button.tooltip('hide').attr('data-original-title', newAction).tooltip('fixTitle'); $button.tooltip('hide').attr('data-original-title', newAction).tooltip('_fixTitle');
} }
return button; return button;

View File

@ -102,7 +102,7 @@ Sidebar.prototype.todoUpdateDone = function(data) {
.attr('title', $el.data(`${attrPrefix}Text`)); .attr('title', $el.data(`${attrPrefix}Text`));
if ($el.hasClass('has-tooltip')) { if ($el.hasClass('has-tooltip')) {
$el.tooltip('fixTitle'); $el.tooltip('_fixTitle');
} }
if ($el.data(`${attrPrefix}Icon`)) { if ($el.data(`${attrPrefix}Icon`)) {

View File

@ -199,7 +199,7 @@ function UsersSelect(currentUser, els, options = {}) {
}; };
} }
$value.html(assigneeTemplate(user)); $value.html(assigneeTemplate(user));
$collapsedSidebar.attr('title', _.escape(user.name)).tooltip('fixTitle'); $collapsedSidebar.attr('title', _.escape(user.name)).tooltip('_fixTitle');
return $collapsedSidebar.html(collapsedAssigneeTemplate(user)); return $collapsedSidebar.html(collapsedAssigneeTemplate(user));
}); });
}; };

View File

@ -6,7 +6,7 @@ export default {
}, },
componentUpdated(el) { componentUpdated(el) {
$(el).tooltip('fixTitle'); $(el).tooltip('_fixTitle');
}, },
unbind(el) { unbind(el) {

View File

@ -628,7 +628,7 @@ Useful links:
// good // good
<span title="tooltip text">Foo</span> <span title="tooltip text">Foo</span>
$('span').tooltip('fixTitle'); $('span').tooltip('_fixTitle');
``` ```
### The Javascript/Vue Accord ### The Javascript/Vue Accord