Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor image diff #31444

Merged
merged 3 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/repo/diff/image_diff.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
data-mime-before="{{.sniffedTypeBase.GetMimeType}}"
data-mime-after="{{.sniffedTypeHead.GetMimeType}}"
>
<overflow-menu class="ui secondary pointing tabular top attached borderless menu">
<overflow-menu class="ui secondary pointing tabular menu custom">
<div class="overflow-menu-items tw-justify-center">
<a class="item active" data-tab="diff-side-by-side-{{.file.Index}}">{{ctx.Locale.Tr "repo.diff.image.side_by_side"}}</a>
{{if and .blobBase .blobHead}}
Expand Down
2 changes: 2 additions & 0 deletions web_src/js/features/common-form.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import $ from 'jquery';
import {initAreYouSure} from '../vendor/jquery.are-you-sure.js';
import {handleGlobalEnterQuickSubmit} from './comp/QuickSubmit.js';

export function initGlobalFormDirtyLeaveConfirm() {
initAreYouSure(window.jQuery);
// Warn users that try to leave a page after entering data into a form.
// Except on sign-in pages, and for forms marked as 'ignore-dirty'.
if (!$('.user.signin').length) {
Expand Down
6 changes: 4 additions & 2 deletions web_src/js/features/common-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function initFootLanguageMenu() {
$('.language-menu a[lang]').on('click', linkLanguageAction);
}

export function initGlobalComponents() {
export function initGlobalDropdown() {
// Semantic UI modules.
const $uiDropdowns = $('.ui.dropdown');

Expand Down Expand Up @@ -68,8 +68,10 @@ export function initGlobalComponents() {
// eg: the "Create New Repo" menu on the navbar.
$uiDropdowns.filter('.upward').dropdown('setting', 'direction', 'upward');
$uiDropdowns.filter('.downward').dropdown('setting', 'direction', 'downward');
}

$('.ui.menu.tabular .item').tab({autoTabActivation: false});
export function initGlobalTabularMenu() {
$('.ui.menu.tabular:not(.custom) .item').tab({autoTabActivation: false});
}

/**
Expand Down
Loading