diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-05-06 15:17:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-06 07:17:22 +0000 |
commit | eda10cc2bb229a6b13ace76caea118384b381429 (patch) | |
tree | 50bb4a2e07cc88e56d92ecd60deb9ba79069bcb8 /web_src | |
parent | ce8b11ae131bef6cd7df0849ed39da7984953a4b (diff) | |
download | gitea-eda10cc2bb229a6b13ace76caea118384b381429.tar.gz gitea-eda10cc2bb229a6b13ace76caea118384b381429.zip |
Fix some UI problems (dropdown/container) (#30849)
Follow #30345
Follow #30547
`ellipsis` / `white-space` shouldn't be put on the general dropdown components.
Diffstat (limited to 'web_src')
-rw-r--r-- | web_src/css/base.css | 22 | ||||
-rw-r--r-- | web_src/css/form.css | 4 | ||||
-rw-r--r-- | web_src/css/modules/container.css | 22 | ||||
-rw-r--r-- | web_src/css/repo.css | 6 | ||||
-rw-r--r-- | web_src/js/components/RepoBranchTagSelector.vue | 4 | ||||
-rw-r--r-- | web_src/js/features/repo-issue.js | 4 |
6 files changed, 40 insertions, 22 deletions
diff --git a/web_src/css/base.css b/web_src/css/base.css index c0ced2955c..412d9094e3 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -342,8 +342,6 @@ a.label, .ui.dropdown .menu > .item { color: var(--color-text); - overflow: hidden; - text-overflow: ellipsis; } .ui.dropdown .menu > .item:hover { @@ -374,7 +372,6 @@ a.label, .ui.selection.dropdown .menu > .item { border-color: var(--color-secondary); - white-space: nowrap; } .ui.selection.visible.dropdown > .text:not(.default) { @@ -1342,7 +1339,11 @@ table th[data-sortt-desc] .svg { align-items: center; gap: .25rem; vertical-align: middle; - min-width: 0; + min-width: 0; /* make ellipsis work */ +} + +.ui.ui.dropdown.selection { + min-width: 14em; /* match the default min width */ } .ui.dropdown .ui.label .svg { @@ -1369,3 +1370,16 @@ table th[data-sortt-desc] .svg { gap: .5rem; min-width: 0; } + +.ui.dropdown.ellipsis-items-nowrap > .text { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.ellipsis-items-nowrap > .item, +.ui.dropdown.ellipsis-items-nowrap .menu > .item { + white-space: nowrap !important; + overflow: hidden !important; + text-overflow: ellipsis !important; +} diff --git a/web_src/css/form.css b/web_src/css/form.css index 7479af0c4e..66ead32762 100644 --- a/web_src/css/form.css +++ b/web_src/css/form.css @@ -448,6 +448,10 @@ textarea:focus, } } +.ui.form .field > .selection.dropdown { + min-width: 14em; /* matches the default min width */ +} + .new.webhook form .help { margin-left: 25px; } diff --git a/web_src/css/modules/container.css b/web_src/css/modules/container.css index 9f67ceb8d5..c9df6ab3f5 100644 --- a/web_src/css/modules/container.css +++ b/web_src/css/modules/container.css @@ -2,26 +2,20 @@ unused rules here after refactoring, please remove them. */ .ui.container { - display: block; - max-width: 100%; -} - -.ui.fluid.container { - width: 100%; -} - -.ui[class*="center aligned"].container { - text-align: center; -} - -/* overwrite width of containers inside the main page content div (div with class "page-content") */ -.page-content .ui.ui.ui.container:not(.fluid) { width: 1280px; max-width: calc(100% - calc(2 * var(--page-margin-x))); margin-left: auto; margin-right: auto; } +.ui.fluid.container { + width: 100%; +} + .ui.container.fluid.padded { padding: 0 var(--page-margin-x); } + +.ui[class*="center aligned"].container { + text-align: center; +} diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 7695b632b4..f02b2b7578 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -2860,6 +2860,10 @@ tbody.commit-list { margin-top: 4px; } +.ui.dropdown.branch-selector-dropdown .scrolling.menu { + max-width: min(400px, 90vw); +} + .branch-selector-dropdown .branch-dropdown-button { margin: 0; max-width: 340px; @@ -2909,6 +2913,8 @@ tbody.commit-list { } .branch-selector-dropdown .menu .item .rss-icon { + position: absolute; + right: 4px; visibility: hidden; /* only show RSS icon on hover */ } diff --git a/web_src/js/components/RepoBranchTagSelector.vue b/web_src/js/components/RepoBranchTagSelector.vue index 8a741b68da..87530225e3 100644 --- a/web_src/js/components/RepoBranchTagSelector.vue +++ b/web_src/js/components/RepoBranchTagSelector.vue @@ -246,7 +246,7 @@ export function initRepoBranchTagSelector(selector) { export default sfc; // activate IDE's Vue plugin </script> <template> - <div class="ui dropdown custom branch-selector-dropdown"> + <div class="ui dropdown custom branch-selector-dropdown ellipsis-items-nowrap"> <div class="ui button branch-dropdown-button" @click="menuVisible = !menuVisible" @keyup.enter="menuVisible = !menuVisible"> <span class="flex-text-block gt-ellipsis"> <template v-if="release">{{ textReleaseCompare }}</template> @@ -280,7 +280,7 @@ export default sfc; // activate IDE's Vue plugin <div class="ui label" v-if="item.name===repoDefaultBranch && mode === 'branches'"> {{ textDefaultBranchLabel }} </div> - <a v-show="enableFeed && mode === 'branches'" role="button" class="rss-icon tw-float-right" :href="rssURLPrefix + item.url" target="_blank" @click.stop> + <a v-show="enableFeed && mode === 'branches'" role="button" class="rss-icon" :href="rssURLPrefix + item.url" target="_blank" @click.stop> <!-- creating a lot of Vue component is pretty slow, so we use a static SVG here --> <svg width="14" height="14" class="svg octicon-rss"><use href="#svg-symbol-octicon-rss"/></svg> </a> diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index d10d4dab8d..8ee681aedc 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -124,8 +124,8 @@ export function initRepoIssueSidebarList() { return; } filteredResponse.results.push({ - name: `#${issue.number} ${htmlEscape(issue.title) - }<div class="text small gt-word-break">${htmlEscape(issue.repository.full_name)}</div>`, + name: `<div class="gt-ellipsis">#${issue.number} ${htmlEscape(issue.title)}</div> +<div class="text small gt-word-break">${htmlEscape(issue.repository.full_name)}</div>`, value: issue.id, }); }); |