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

[stable2] Add tooltips in app sidebar header #1560

Merged
merged 1 commit into from
Nov 9, 2020
Merged
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
17 changes: 15 additions & 2 deletions src/components/AppSidebar/AppSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,10 @@
}"
class="app-sidebar-header">
<!-- close sidebar button -->
<a href="#"
<a
v-tooltip.auto="t('close')"
href="#"
class="app-sidebar__close icon-close"
:title="t('close')"
@click.prevent="closeSidebar" />

<!-- container for figure and description, allows easy switching to compact mode -->
Expand Down Expand Up @@ -178,6 +179,7 @@
<!-- main title -->
<h2 v-show="!titleEditable"
v-linkify="{text: title, linkify: linkifyTitle}"
v-tooltip.auto="titleTooltip"
class="app-sidebar-header__maintitle"
@click.self="editTitle">
{{ title }}
Expand Down Expand Up @@ -234,6 +236,7 @@
import Actions from '../Actions'
import Focus from '../../directives/Focus'
import Linkify from '../../directives/Linkify'
import Tooltip from '../../directives/Tooltip'
import l10n from '../../mixins/l10n'
import AppSidebarTabs from './AppSidebarTabs'
import EmptyContent from '../EmptyContent/EmptyContent'
Expand All @@ -252,6 +255,7 @@ export default {
focus: Focus,
linkify: Linkify,
ClickOutside,
Tooltip,
},

mixins: [l10n],
Expand Down Expand Up @@ -348,6 +352,15 @@ export default {
type: Boolean,
default: false,
},

/**
* Tooltip to display for the title.
* Can be set to the same text in case it's too long.
*/
titleTooltip: {
type: String,
default: '',
},
},

data() {
Expand Down