Minor reminders fix (#1311)

Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
Denis Bykhov 2022-04-07 11:24:46 +06:00 committed by GitHub
parent 6543fdf4b7
commit 08efb17a26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 11 deletions

View File

@ -54,11 +54,9 @@
if (!opened) {
opened = true
showPopup(TimeShiftPopup, { title, value, direction }, container, (ev) => {
console.log('picker close handle')
console.log(ev)
changeValue(ev)
opened = false
}, changeValue)
})
}
}}
>

View File

@ -33,8 +33,8 @@
<div class="antiPopup">
{#each values as value}
<div class="ap-menuItem">
<TimeShiftPresenter value={value * base} on:click={() => { dispatch('close', value) }} />
<div class="ap-menuItem" on:click={() => { dispatch('close', value) }} >
<TimeShiftPresenter value={value * base}/>
</div>
{/each}
</div>

View File

@ -26,8 +26,6 @@
let time: string = ''
async function formatTime (value: number) {
console.log('value')
console.log(value)
if (value > 0) {
if (value < HOUR) {
time = await translate(ui.string.MinutesAfter, { minutes: Math.floor(value / MINUTE) })
@ -52,4 +50,4 @@
</script>
<span style="white-space: nowrap;" on:click>{time}</span>
<span style="white-space: nowrap;">{time}</span>

View File

@ -33,7 +33,7 @@
const client = getClient()
export function canClose (): boolean {
return title.trim().length === 0 && participants.length === 0
return title !== undefined && title.trim().length === 0 && participants.length === 0
}
async function saveReminder () {
@ -58,7 +58,7 @@
<Card
label={calendar.string.CreateReminder}
okAction={saveReminder}
canSave={title.trim().length > 0 && participants.length > 0}
canSave={title !== undefined && title.trim().length > 0 && participants.length > 0}
{space}
on:close={() => {
dispatch('close')

View File

@ -39,7 +39,7 @@
if (current === undefined) {
showPopup(CreateReminder, { attachedTo: value._id, attachedToClass: value._class, title }, ev.target as HTMLElement)
} else {
showPopup(DocRemindersPopup, { attachedTo: value._id, attachedToClass: value._class }, ev.target as HTMLElement )
showPopup(DocRemindersPopup, { attachedTo: value._id, attachedToClass: value._class, title }, ev.target as HTMLElement )
}
}
}