Skip to content

Commit ccac2fe

Browse files
committed
Merge branch 'main' into refactor-tooltip-content
# Conflicts: # templates/repo/sub_menu.tmpl
2 parents 1905b8b + 9be90a5 commit ccac2fe

File tree

11 files changed

+109
-62
lines changed

11 files changed

+109
-62
lines changed

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"vue": "3.2.47",
4444
"vue-bar-graph": "2.0.0",
4545
"vue-loader": "17.0.1",
46-
"vue3-calendar-heatmap": "2.0.0",
46+
"vue3-calendar-heatmap": "2.0.2",
4747
"webpack": "5.76.2",
4848
"webpack-cli": "5.0.1",
4949
"workbox-routing": "6.5.4",

templates/repo/issue/view_content/sidebar.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,9 +661,9 @@
661661
{{if and (not (eq .Issue.PullRequest.HeadRepo.FullName .Issue.PullRequest.BaseRepo.FullName)) .CanWriteToHeadRepo}}
662662
<div class="ui divider"></div>
663663
<div class="inline field">
664-
<div class="ui checkbox" id="allow-edits-from-maintainers"
664+
<div class="ui checkbox tooltip" id="allow-edits-from-maintainers"
665665
data-url="{{.Issue.Link}}"
666-
data-prompt-tip="{{.locale.Tr "repo.pulls.allow_edits_from_maintainers_desc"}}"
666+
data-tooltip-content="{{.locale.Tr "repo.pulls.allow_edits_from_maintainers_desc"}}"
667667
data-prompt-error="{{.locale.Tr "repo.pulls.allow_edits_from_maintainers_err"}}"
668668
>
669669
<label><strong>{{.locale.Tr "repo.pulls.allow_edits_from_maintainers"}}</strong></label>

web_src/js/components/DashboardRepoList.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@
147147
<script>
148148
import {createApp, nextTick} from 'vue';
149149
import $ from 'jquery';
150-
import {initTooltip} from '../modules/tippy.js';
151150
import {SvgIcon} from '../svg.js';
152151
153152
const {appSubUrl, assetUrlPrefix, pageData} = window.config;
@@ -238,9 +237,6 @@ const sfc = {
238237
mounted() {
239238
const el = document.getElementById('dashboard-repo-list');
240239
this.changeReposFilter(this.reposFilter);
241-
for (const elTooltip of el.querySelectorAll('.tooltip')) {
242-
initTooltip(elTooltip);
243-
}
244240
$(el).find('.dropdown').dropdown();
245241
nextTick(() => {
246242
this.$refs.search.focus();

web_src/js/components/DiffFileList.vue

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
</template>
2222

2323
<script>
24-
import {initTooltip} from '../modules/tippy.js';
2524
import {doLoadMoreFiles} from '../features/repo-diff.js';
2625
2726
const {pageData} = window.config;
@@ -30,17 +29,6 @@ export default {
3029
data: () => {
3130
return pageData.diffFileInfo;
3231
},
33-
watch: {
34-
fileListIsVisible(newValue) {
35-
if (newValue === true) {
36-
this.$nextTick(() => {
37-
for (const el of this.$refs.root.querySelectorAll('.tooltip')) {
38-
initTooltip(el);
39-
}
40-
});
41-
}
42-
}
43-
},
4432
mounted() {
4533
document.getElementById('show-file-list-btn').addEventListener('click', this.toggleFileList);
4634
},

web_src/js/features/common-global.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {createDropzone} from './dropzone.js';
55
import {initCompColorPicker} from './comp/ColorPicker.js';
66
import {showGlobalErrorMessage} from '../bootstrap.js';
77
import {handleGlobalEnterQuickSubmit} from './comp/QuickSubmit.js';
8-
import {initTooltip} from '../modules/tippy.js';
98
import {svg} from '../svg.js';
109
import {hideElem, showElem, toggleElem} from '../utils/dom.js';
1110

@@ -66,12 +65,6 @@ export function initGlobalButtonClickOnEnter() {
6665
});
6766
}
6867

69-
export function initGlobalTooltips() {
70-
for (const el of document.getElementsByClassName('tooltip')) {
71-
initTooltip(el);
72-
}
73-
}
74-
7568
export function initGlobalCommon() {
7669
// Undo Safari emoji glitch fix at high enough zoom levels
7770
if (navigator.userAgent.match('Safari')) {

web_src/js/features/contextpopup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export function initContextPopups() {
3030

3131
createTippy(this, {
3232
content: el,
33+
placement: 'top-start',
3334
interactive: true,
3435
interactiveBorder: 5,
3536
onShow: () => {

web_src/js/features/repo-diff.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {initCompReactionSelector} from './comp/ReactionSelector.js';
33
import {initRepoIssueContentHistory} from './repo-issue-content.js';
44
import {validateTextareaNonEmpty} from './comp/EasyMDE.js';
55
import {initViewedCheckboxListenerFor, countAndUpdateViewedFiles} from './pull-view-file.js';
6-
import {initTooltip} from '../modules/tippy.js';
76

87
const {csrfToken} = window.config;
98

@@ -60,10 +59,6 @@ export function initRepoDiffConversationForm() {
6059
const $newConversationHolder = $(await $.post($form.attr('action'), formDataString));
6160
const {path, side, idx} = $newConversationHolder.data();
6261

63-
$newConversationHolder.find('.tooltip').each(function () {
64-
initTooltip(this);
65-
});
66-
6762
$form.closest('.conversation-holder').replaceWith($newConversationHolder);
6863
if ($form.closest('tr').data('line-type') === 'same') {
6964
$(`[data-path="${path}"] a.add-code-comment[data-idx="${idx}"]`).addClass('invisible');

web_src/js/features/repo-issue.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {attachTribute} from './tribute.js';
44
import {createCommentEasyMDE, getAttachedEasyMDE} from './comp/EasyMDE.js';
55
import {initEasyMDEImagePaste} from './comp/ImagePaste.js';
66
import {initCompMarkupContentPreviewTab} from './comp/MarkupContentPreview.js';
7-
import {initTooltip, showTemporaryTooltip, createTippy} from '../modules/tippy.js';
7+
import {showTemporaryTooltip, createTippy} from '../modules/tippy.js';
88
import {hideElem, showElem, toggleElem} from '../utils/dom.js';
99
import {setFileFolding} from './file-fold.js';
1010

@@ -280,10 +280,7 @@ export function initRepoPullRequestAllowMaintainerEdit() {
280280
const $checkbox = $('#allow-edits-from-maintainers');
281281
if (!$checkbox.length) return;
282282

283-
const promptTip = $checkbox.attr('data-prompt-tip');
284283
const promptError = $checkbox.attr('data-prompt-error');
285-
286-
initTooltip($checkbox[0], {content: promptTip});
287284
$checkbox.checkbox({
288285
'onChange': () => {
289286
const checked = $checkbox.checkbox('is checked');

web_src/js/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ import {
5656
initGlobalFormDirtyLeaveConfirm,
5757
initGlobalLinkActions,
5858
initHeadNavbarContentToggle,
59-
initGlobalTooltips,
6059
} from './features/common-global.js';
6160
import {initRepoTopicBar} from './features/repo-home.js';
6261
import {initAdminEmails} from './features/admin/emails.js';
@@ -91,6 +90,7 @@ import {initCaptcha} from './features/captcha.js';
9190
import {initRepositoryActionView} from './components/RepoActionView.vue';
9291
import {initAriaCheckboxPatch} from './modules/aria/checkbox.js';
9392
import {initAriaDropdownPatch} from './modules/aria/dropdown.js';
93+
import {initGlobalTooltips} from './modules/tippy.js';
9494

9595
// Run time-critical code as soon as possible. This is safe to do because this
9696
// script appears at the end of <body> and rendered HTML is accessible at that point.

0 commit comments

Comments
 (0)