fix Cliccando sul Titolo dell'evento, si apre una pagina in una nuova finestra ! (non rimane sulla APP)

This commit is contained in:
Surya Paolo
2022-12-02 13:24:20 +01:00
parent 009735afad
commit 9b7b25e657
26 changed files with 1201 additions and 499 deletions

View File

@@ -1,49 +1,55 @@
<template>
<div class="q-pr-md">
<q-layout
view="hHh Lpr lff" container :style="`height: ` + getheight + `px`"
class="shadow-2 rounded-borders messages_page">
view="hHh Lpr lff"
container
:style="`height: ` + getheight + `px`"
class="shadow-2 rounded-borders messages_page"
>
<q-drawer
v-model="mydrawer"
:mini="!mydrawer || miniState"
@click.capture="drawerClick"
:width="widthdrawer"
:breakpoint="300"
bordered
content-class="bg-grey-3">
content-class="bg-grey-3"
>
<q-scroll-area class="fit">
<q-list bordered class="rounded-borders chat-list">
<q-item-label header class="title_msg">{{ $t('msgs.messages') }}</q-item-label>
<q-item-label header class="title_msg">{{
$t('msgs.messages')
}}</q-item-label>
<q-separator/>
<q-separator />
<div v-if="getNumMsg() === 0">
<q-item>
{{ $t('msgs.nomessage') }}
</q-item>
</div>
<q-item
clickable
:active="isMenuActive(msg.dest.username)"
active-class="active-user"
v-for="(msg, index) in lasts_messages()"
:key="index"
@click="selChat(msg)">
@click="selChat(msg)"
>
<q-item-section avatar>
<q-avatar>
<img :src="getImgByMsg(msg)" :alt="getUsernameChatByMsg(msg)">
<img
:src="getImgByMsg(msg)"
:alt="getUsernameChatByMsg(msg)"
/>
</q-avatar>
</q-item-section>
<q-item-section>
<q-item-label lines="1">{{ getUsernameChatByMsg(msg) }}</q-item-label>
<q-item-label lines="1">{{
getUsernameChatByMsg(msg)
}}</q-item-label>
<q-item-label caption lines="2">
{{ getMsgText(msg, false) }}
</q-item-label>
@@ -54,18 +60,22 @@
</q-item-section>
</q-item>
<q-separator/>
<q-separator />
</q-list>
</q-scroll-area>
<div class="q-mini-drawer-hide absolute" style="top: 15px; right: -17px">
<div
class="q-mini-drawer-hide absolute"
style="top: 15px; right: -17px"
>
<q-btn
dense
round
unelevated
color="accent"
icon="chevron_left"
@click="miniState = true">
@click="miniState = true"
>
</q-btn>
</div>
</q-drawer>
@@ -75,36 +85,53 @@
<q-page-container style="">
<q-page class="q-px-lg q-py-md">
<div>
<q-item clickable v-if="!!chatsel.username" @scroll="myonScroll">
<q-item
clickable
v-if="!!chatsel.username"
@scroll="myonScroll"
>
<q-item-section avatar>
<CMyAvatar :username="chatsel.username"></CMyAvatar>
</q-item-section>
<q-item-section>
<q-item-label lines="1">{{ getUserByUsername(chatsel.username) }}</q-item-label>
<q-item-label lines="1">{{
getUserByUsername(chatsel.username)
}}</q-item-label>
<q-item-label caption lines="2">
{{ func_tools.getDateTimeShortStr(chatsel.lasttimeActive) }}
{{
func_tools.getDateTimeShortStr(chatsel.lasttimeActive)
}}
</q-item-label>
</q-item-section>
</q-item>
</div>
<q-separator/>
<q-separator />
<div class="q-pa-md">
<q-item
clickable v-for="(msg, index) in msgchat_records()" :key="index">
clickable
v-for="(msg, index) in msgchat_records()"
:key="index"
>
<div v-if="msg.dest">
<div>
<div class="chat_dest" v-if="msg.dest.username === Username()">
<div
class="chat_dest"
v-if="msg.dest.username === Username()"
>
<q-chat-message
:name="getUsernameChatByMsg(msg)"
:text="getMsgText(msg, true)"
:stamp="tools.getstrDateTimeShort(msg.datemsg)"
text-color="black"
bg-color="grey-2">
:text-color="$q.dark.isActive ? `white` : `black`"
bg-color="grey-2"
>
<template v-slot:avatar>
<q-avatar size="sm">
<img :src="getImgByMsg(msg)" :alt="getUsernameChatByMsg(msg)">
<img
:src="getImgByMsg(msg)"
:alt="getUsernameChatByMsg(msg)"
/>
</q-avatar>
</template>
</q-chat-message>
@@ -115,37 +142,32 @@
:text="getMsgText(msg, true)"
:stamp="tools.getstrDateTimeShort(msg.datemsg)"
sent
bg-color="blue-2">
bg-color="blue-2"
>
<template v-slot:avatar>
<CMyAvatar size="sm" :username="Username()"></CMyAvatar>
<CMyAvatar
size="sm"
:username="Username()"
></CMyAvatar>
</template>
</q-chat-message>
</div>
</div>
</div>
</q-item>
<div id="last"></div>
<q-inner-loading id="spinner" :showing="loading">
<q-spinner-tail
color="primary"
size="4em">
</q-spinner-tail>
<q-spinner-tail color="primary" size="4em"> </q-spinner-tail>
</q-inner-loading>
</div>
</q-page>
</q-page-container>
</div>
<div class="bottomfixed row" :style="styletextbar">
<div class="" style="max-width: 50px; align-self: center; order: 1;">
<q-btn
rounded
size="sm"
icon="fas fa-smile">
</q-btn>
<div class="" style="max-width: 50px; align-self: center; order: 1">
<q-btn rounded size="sm" icon="fas fa-smile"> </q-btn>
</div>
<div class="" style="max-height: 100px; flex-grow:1; order: 2;">
<div class="" style="max-height: 100px; flex-grow: 1; order: 2">
<q-input
bordered
rounded
@@ -153,17 +175,12 @@
debounce="1000"
filled
autogrow
input-style="max-height: 95px;">
input-style="max-height: 95px;"
>
</q-input>
</div>
<div class="" style="max-width: 50px; align-self: center; order: 3;">
<q-btn
push
rounded
size="sm"
icon="send"
@click="sendMsg">
</q-btn>
<div class="" style="max-width: 50px; align-self: center; order: 3">
<q-btn push rounded size="sm" icon="send" @click="sendMsg"> </q-btn>
</div>
</div>
</div>