-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
web/satellite added middle truncation logic for filenames in file bro…
…wser Added middle truncation and extended filename on hover according to figma designs Change-Id: I5559abc6e6d959491603c0d2d20ddfbfdc298eee
- Loading branch information
1 parent
023a1c6
commit e26b151
Showing
4 changed files
with
74 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright (C) 2022 Storj Labs, Inc. | ||
// See LICENSE for copying information. | ||
|
||
<template> | ||
<div class="truncation-container"> | ||
<div class="first-part-text">{{ textFirstPart }}</div> | ||
<div class="last-part-text">{{ textLastPart }}</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { Component, Prop, Vue } from "vue-property-decorator"; | ||
// @vue/component | ||
@Component | ||
export default class MiddleTruncate extends Vue { | ||
@Prop() | ||
private readonly text: string; | ||
public get textFirstPart(): string { | ||
return this.text.substring(0, this.text.length - 5); | ||
} | ||
public get textLastPart(): string { | ||
return this.text.substring(this.text.length - 5); | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
.truncation-container { | ||
display: inline-flex; | ||
max-width: 30ch; | ||
min-width: 0; | ||
&:hover { | ||
max-width: unset; | ||
min-width: auto; | ||
background-color: #efefee; | ||
} | ||
} | ||
.first-part-text { | ||
flex-grow: 1; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
} | ||
.last-part-text { | ||
flex-shrink: 0; | ||
} | ||
</style> |
e26b151
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit has been mentioned on Storj Community Forum (official). There might be relevant details there:
https://forum.storj.io/t/release-preparation-v1-59/18983/1