mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-28 05:56:02 +03:00
Move and update ShowMore. Limits in CommentPresenter. (#690)
Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
parent
538c5529a9
commit
f5aa8249dc
@ -4,6 +4,8 @@
|
|||||||
"Minutes": "{minutes, plural, =0 {less than a minute ago} =1 {a minute ago} other {# minutes ago}}",
|
"Minutes": "{minutes, plural, =0 {less than a minute ago} =1 {a minute ago} other {# minutes ago}}",
|
||||||
"Hours": "{hours, plural, =0 {less than an hour ago} =1 {an hour ago} other {# hours ago}}",
|
"Hours": "{hours, plural, =0 {less than an hour ago} =1 {an hour ago} other {# hours ago}}",
|
||||||
"Days": "{days, plural, =0 {today} =1 {yesterday} other {# days ago}}",
|
"Days": "{days, plural, =0 {today} =1 {yesterday} other {# days ago}}",
|
||||||
"Clear": "Clear"
|
"Clear": "Clear",
|
||||||
|
"ShowMore": "Show more",
|
||||||
|
"ShowLess": "Show less"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,11 +15,12 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Label } from '@anticrm/ui'
|
import Label from './Label.svelte'
|
||||||
import activity from '@anticrm/activity'
|
import ui from '..'
|
||||||
|
|
||||||
export let limit: number = 240
|
export let limit: number = 240
|
||||||
export let ignore: boolean = false
|
export let ignore: boolean = false
|
||||||
|
export let fixed: boolean = false
|
||||||
|
|
||||||
let cHeight: number
|
let cHeight: number
|
||||||
let bigger: boolean = false
|
let bigger: boolean = false
|
||||||
@ -37,11 +38,12 @@
|
|||||||
class="showMore-content"
|
class="showMore-content"
|
||||||
class:crop={!ignore && crop}
|
class:crop={!ignore && crop}
|
||||||
class:full={bigger && !ignore && !crop}
|
class:full={bigger && !ignore && !crop}
|
||||||
|
style={(!ignore && crop) ? `max-height: ${limit}px;` : ''}
|
||||||
><slot /></div>
|
><slot /></div>
|
||||||
|
|
||||||
{#if !ignore && bigger}
|
{#if !ignore && bigger && !fixed}
|
||||||
<div class="showMore" class:outter={cHeight > limit} on:click={toggle}>
|
<div class="showMore" class:outter={cHeight > limit} on:click={toggle}>
|
||||||
<Label label={(cHeight > limit) ? activity.string.ShowLess : activity.string.ShowMore} />
|
<Label label={(cHeight > limit) ? ui.string.ShowLess : ui.string.ShowMore} />
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
@ -61,6 +61,7 @@ export { default as Link } from './components/Link.svelte'
|
|||||||
export { default as TimeSince } from './components/TimeSince.svelte'
|
export { default as TimeSince } from './components/TimeSince.svelte'
|
||||||
export { default as Dropdown } from './components/Dropdown.svelte'
|
export { default as Dropdown } from './components/Dropdown.svelte'
|
||||||
export { default as DumbDropdown } from './components/DumbDropdown.svelte'
|
export { default as DumbDropdown } from './components/DumbDropdown.svelte'
|
||||||
|
export { default as ShowMore } from './components/ShowMore.svelte'
|
||||||
export { default as StatusesBar } from './components/StatusesBar.svelte'
|
export { default as StatusesBar } from './components/StatusesBar.svelte'
|
||||||
|
|
||||||
export { default as IconAdd } from './components/icons/Add.svelte'
|
export { default as IconAdd } from './components/icons/Add.svelte'
|
||||||
|
@ -28,6 +28,8 @@ import { plugin } from '@anticrm/platform'
|
|||||||
Minutes: '' as IntlString,
|
Minutes: '' as IntlString,
|
||||||
Hours: '' as IntlString,
|
Hours: '' as IntlString,
|
||||||
Days: '' as IntlString,
|
Days: '' as IntlString,
|
||||||
Clear: '' as IntlString
|
Clear: '' as IntlString,
|
||||||
|
ShowMore: '' as IntlString,
|
||||||
|
ShowLess: '' as IntlString
|
||||||
}
|
}
|
||||||
})
|
})
|
@ -3,8 +3,6 @@
|
|||||||
"Delete": "Delete",
|
"Delete": "Delete",
|
||||||
"Edit": "Edit",
|
"Edit": "Edit",
|
||||||
"Options": "Options",
|
"Options": "Options",
|
||||||
"Edited": "edited",
|
"Edited": "edited"
|
||||||
"ShowMore": "Show more",
|
|
||||||
"ShowLess": "Show less"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -31,12 +31,12 @@
|
|||||||
Label,
|
Label,
|
||||||
Menu,
|
Menu,
|
||||||
showPopup,
|
showPopup,
|
||||||
TimeSince
|
TimeSince,
|
||||||
|
ShowMore
|
||||||
} from '@anticrm/ui'
|
} from '@anticrm/ui'
|
||||||
import type { AttributeModel } from '@anticrm/view'
|
import type { AttributeModel } from '@anticrm/view'
|
||||||
import { buildModel, getActions, getObjectPresenter } from '@anticrm/view-resources'
|
import { buildModel, getActions, getObjectPresenter } from '@anticrm/view-resources'
|
||||||
import { activityKey, ActivityKey, DisplayTx } from '../activity'
|
import { activityKey, ActivityKey, DisplayTx } from '../activity'
|
||||||
import ShowMore from './ShowMore.svelte'
|
|
||||||
|
|
||||||
export let tx: DisplayTx
|
export let tx: DisplayTx
|
||||||
export let viewlets: Map<ActivityKey, TxViewlet>
|
export let viewlets: Map<ActivityKey, TxViewlet>
|
||||||
|
@ -52,9 +52,7 @@ export default plugin(activityId, {
|
|||||||
Delete: '' as IntlString,
|
Delete: '' as IntlString,
|
||||||
Edit: '' as IntlString,
|
Edit: '' as IntlString,
|
||||||
Options: '' as IntlString,
|
Options: '' as IntlString,
|
||||||
Edited: '' as IntlString,
|
Edited: '' as IntlString
|
||||||
ShowMore: '' as IntlString,
|
|
||||||
ShowLess: '' as IntlString
|
|
||||||
},
|
},
|
||||||
icon: {
|
icon: {
|
||||||
Activity: '' as Asset
|
Activity: '' as Asset
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
import type { Comment } from '@anticrm/chunter'
|
import type { Comment } from '@anticrm/chunter'
|
||||||
import { formatName } from '@anticrm/contact'
|
import { formatName } from '@anticrm/contact'
|
||||||
import { Avatar, getClient, MessageViewer } from '@anticrm/presentation'
|
import { Avatar, getClient, MessageViewer } from '@anticrm/presentation'
|
||||||
import { TimeSince } from '@anticrm/ui'
|
import { TimeSince, ShowMore } from '@anticrm/ui'
|
||||||
import { getTime, getUser } from '../utils'
|
import { getTime, getUser } from '../utils'
|
||||||
|
|
||||||
export let value: Comment
|
export let value: Comment
|
||||||
@ -39,9 +39,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="content-trans-color ml-4"><TimeSince value={value.modifiedOn} /></div>
|
<div class="content-trans-color ml-4"><TimeSince value={value.modifiedOn} /></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="comment-content">
|
<ShowMore limit={126} fixed>
|
||||||
<MessageViewer message={value.message}/>
|
<MessageViewer message={value.message}/>
|
||||||
</div>
|
</ShowMore>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -56,13 +56,13 @@
|
|||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
margin-bottom: .25rem;
|
margin-bottom: .25rem;
|
||||||
}
|
}
|
||||||
.comment-content {
|
// .comment-content {
|
||||||
overflow: hidden;
|
// overflow: hidden;
|
||||||
visibility: visible;
|
// visibility: visible;
|
||||||
display: -webkit-box;
|
// display: -webkit-box;
|
||||||
-webkit-line-clamp: 7;
|
// -webkit-line-clamp: 7;
|
||||||
line-clamp: 7;
|
// line-clamp: 7;
|
||||||
/* autoprefixer: ignore next */
|
// /* autoprefixer: ignore next */
|
||||||
-webkit-box-orient: vertical;
|
// -webkit-box-orient: vertical;
|
||||||
}
|
// }
|
||||||
</style>
|
</style>
|
Loading…
Reference in New Issue
Block a user