Some fixes
This commit is contained in:
parent
bd24d4c1bc
commit
bd7350ac74
@ -703,10 +703,12 @@ class AppMediaPlaybackController {
|
||||
return () => {
|
||||
this.toggleSwitchers(true);
|
||||
|
||||
if(this.mediaDetails.get(playingMedia)) {
|
||||
this.setMedia(playingMedia, this.getMessageByMedia(playingMedia));
|
||||
} else {
|
||||
this.next() || this.previous();
|
||||
if(playingMedia) {
|
||||
if(this.mediaDetails.get(playingMedia)) {
|
||||
this.setMedia(playingMedia, this.getMessageByMedia(playingMedia));
|
||||
} else {
|
||||
this.next() || this.previous();
|
||||
}
|
||||
}
|
||||
|
||||
if(this.playingMedia === media) {
|
||||
|
@ -246,7 +246,7 @@ function wrapAudio(audioEl: AudioElement) {
|
||||
}
|
||||
|
||||
if(withTime) {
|
||||
parts.push(formatFullSentTime(doc.date));
|
||||
parts.push(formatFullSentTime(message.date));
|
||||
} else if(!parts.length) {
|
||||
parts.push(formatBytes(doc.size));
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ export default class PinnedContainer {
|
||||
|
||||
protected floating = false;
|
||||
|
||||
protected onClose?: () => void | Promise<boolean>;
|
||||
public onClose?: () => void | Promise<boolean>;
|
||||
|
||||
constructor(options: {
|
||||
topbar: PinnedContainer['topbar'],
|
||||
@ -45,7 +45,7 @@ export default class PinnedContainer {
|
||||
}) {
|
||||
safeAssign(this, options);
|
||||
|
||||
const {divAndCaption, className, onClose} = this;
|
||||
const {divAndCaption, className} = this;
|
||||
divAndCaption.container.classList.add(CLASSNAME_BASE, 'hide');
|
||||
divAndCaption.title.classList.add(CLASSNAME_BASE + '-title');
|
||||
divAndCaption.subtitle.classList.add(CLASSNAME_BASE + '-subtitle');
|
||||
@ -66,10 +66,14 @@ export default class PinnedContainer {
|
||||
|
||||
divAndCaption.container.append(this.wrapper/* , this.close */);
|
||||
|
||||
attachClickEvent(this.btnClose, (e) => {
|
||||
this.attachOnCloseEvent(this.btnClose);
|
||||
}
|
||||
|
||||
public attachOnCloseEvent(elem: HTMLElement) {
|
||||
attachClickEvent(elem, (e) => {
|
||||
cancelEvent(e);
|
||||
|
||||
((onClose ? onClose() : null) || Promise.resolve(true)).then(needClose => {
|
||||
((this.onClose ? this.onClose() : null) || Promise.resolve(true)).then(needClose => {
|
||||
if(needClose) {
|
||||
this.toggle(true);
|
||||
}
|
||||
|
@ -288,7 +288,9 @@ export default class ChatPinnedMessage {
|
||||
this.animatedCounter = new AnimatedCounter(true);
|
||||
dAC.title.append(i18n('PinnedMessage'), ' ', this.animatedCounter.container);
|
||||
|
||||
dAC.container.prepend(this.pinnedMessageContainer.btnClose);
|
||||
const btnClose = this.pinnedMessageContainer.btnClose.cloneNode(true) as HTMLElement;
|
||||
this.pinnedMessageContainer.attachOnCloseEvent(btnClose);
|
||||
dAC.container.prepend(btnClose);
|
||||
|
||||
this.btnOpen = ButtonIcon('pinlist pinned-container-close pinned-message-pinlist', {noRipple: true});
|
||||
|
||||
|
@ -611,7 +611,7 @@ export function wrapDocument({message, withTime, fontWeight, voiceAsMusic, showS
|
||||
const descriptionParts: (HTMLElement | string | DocumentFragment)[] = [formatBytes(doc.size)];
|
||||
|
||||
if(withTime) {
|
||||
descriptionParts.push(formatFullSentTime(doc.date));
|
||||
descriptionParts.push(formatFullSentTime(message.date));
|
||||
}
|
||||
|
||||
if(showSender) {
|
||||
|
@ -271,6 +271,7 @@
|
||||
height: 100%;
|
||||
border-radius: 0;
|
||||
z-index: 0;
|
||||
max-width: 100%;
|
||||
|
||||
@include respond-to(handhelds) {
|
||||
padding: 0 .5rem;
|
||||
@ -334,10 +335,6 @@
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
&-close {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&-wrapper {
|
||||
display: flex;
|
||||
flex: 1 1 auto;
|
||||
@ -421,7 +418,11 @@
|
||||
margin-right: 2.25rem;
|
||||
} */
|
||||
|
||||
.pinned-message-close {
|
||||
.pinned-container-wrapper-utils {
|
||||
display: none;
|
||||
}
|
||||
|
||||
> .pinned-message-close {
|
||||
display: flex;
|
||||
margin-right: .75rem;
|
||||
order: 0;
|
||||
@ -582,6 +583,7 @@
|
||||
|
||||
&.is-floating {
|
||||
--container-height: var(--pinned-audio-height);
|
||||
z-index: 1; // fix z-index for volume selector
|
||||
}
|
||||
|
||||
&:not(.is-floating) {
|
||||
|
Loading…
Reference in New Issue
Block a user