Get rid of some .innerHTML
This commit is contained in:
parent
523a0366b0
commit
e617a5f547
|
@ -246,7 +246,7 @@ export default class AppMediaViewer extends AppMediaViewerBase<'caption', 'delet
|
||||||
|
|
||||||
private setCaption(message: MyMessage) {
|
private setCaption(message: MyMessage) {
|
||||||
const caption = (message as Message.message).message;
|
const caption = (message as Message.message).message;
|
||||||
let html: Parameters<typeof setInnerHTML>[1] = '';
|
let html: Parameters<typeof setInnerHTML>[1];
|
||||||
if(caption) {
|
if(caption) {
|
||||||
const media = getMediaFromMessage(message, true);
|
const media = getMediaFromMessage(message, true);
|
||||||
|
|
||||||
|
|
|
@ -859,7 +859,7 @@ export default class AppMediaViewerBase<
|
||||||
const mover = this.content.mover;
|
const mover = this.content.mover;
|
||||||
|
|
||||||
if(!closing) {
|
if(!closing) {
|
||||||
mover.innerHTML = '';
|
mover.replaceChildren();
|
||||||
// mover.append(this.buttons.prev, this.buttons.next);
|
// mover.append(this.buttons.prev, this.buttons.next);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1205,7 +1205,7 @@ export default class AppMediaViewerBase<
|
||||||
}, delay / 2);
|
}, delay / 2);
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
mover.innerHTML = '';
|
mover.replaceChildren();
|
||||||
mover.classList.remove('moving', 'active', 'hiding');
|
mover.classList.remove('moving', 'active', 'hiding');
|
||||||
mover.style.cssText = 'display: none;';
|
mover.style.cssText = 'display: none;';
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ export class SearchGroup {
|
||||||
this.container.style.display = 'none';
|
this.container.style.display = 'none';
|
||||||
|
|
||||||
if(this.clearable) {
|
if(this.clearable) {
|
||||||
this.list.innerHTML = '';
|
this.list.replaceChildren();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ export default class AutocompleteHelper extends EventListenerBase<{
|
||||||
this.attach = undefined;
|
this.attach = undefined;
|
||||||
this.detach = undefined;
|
this.detach = undefined;
|
||||||
|
|
||||||
list.innerHTML = '';
|
list.replaceChildren();
|
||||||
detach();
|
detach();
|
||||||
|
|
||||||
if(this.navigationItem) {
|
if(this.navigationItem) {
|
||||||
|
|
|
@ -59,7 +59,7 @@ export default class AutocompletePeerHelper extends AutocompleteHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(data.length) {
|
if(data.length) {
|
||||||
this.list.innerHTML = '';
|
this.list.replaceChildren();
|
||||||
data.forEach((d) => {
|
data.forEach((d) => {
|
||||||
const div = AutocompletePeerHelper.listElement({
|
const div = AutocompletePeerHelper.listElement({
|
||||||
className: this.className,
|
className: this.className,
|
||||||
|
|
|
@ -3962,7 +3962,7 @@ export default class ChatBubbles {
|
||||||
|
|
||||||
bubble.className = 'bubble service';
|
bubble.className = 'bubble service';
|
||||||
|
|
||||||
bubbleContainer.innerHTML = '';
|
bubbleContainer.replaceChildren();
|
||||||
const s = document.createElement('div');
|
const s = document.createElement('div');
|
||||||
s.classList.add('service-msg');
|
s.classList.add('service-msg');
|
||||||
if(action) {
|
if(action) {
|
||||||
|
@ -4129,7 +4129,7 @@ export default class ChatBubbles {
|
||||||
maxMediaTimestamp
|
maxMediaTimestamp
|
||||||
};
|
};
|
||||||
|
|
||||||
const richText = messageMessage ? wrapRichText(messageMessage, richTextOptions) : '';
|
const richText = messageMessage ? wrapRichText(messageMessage, richTextOptions) : undefined;
|
||||||
|
|
||||||
let canHaveTail = true;
|
let canHaveTail = true;
|
||||||
let isStandaloneMedia = false;
|
let isStandaloneMedia = false;
|
||||||
|
|
|
@ -422,7 +422,7 @@ export default class ChatContextMenu {
|
||||||
icon: 'copy',
|
icon: 'copy',
|
||||||
text: 'Text.Context.Copy.Username',
|
text: 'Text.Context.Copy.Username',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
copyTextToClipboard(this.target.innerHTML);
|
copyTextToClipboard(this.target.textContent);
|
||||||
},
|
},
|
||||||
verify: () => this.isUsernameTarget,
|
verify: () => this.isUsernameTarget,
|
||||||
withSelection: true
|
withSelection: true
|
||||||
|
@ -430,7 +430,7 @@ export default class ChatContextMenu {
|
||||||
icon: 'copy',
|
icon: 'copy',
|
||||||
text: 'Text.Context.Copy.Hashtag',
|
text: 'Text.Context.Copy.Hashtag',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
copyTextToClipboard(this.target.innerHTML);
|
copyTextToClipboard(this.target.textContent);
|
||||||
},
|
},
|
||||||
verify: () => this.target.classList.contains('anchor-hashtag'),
|
verify: () => this.target.classList.contains('anchor-hashtag'),
|
||||||
withSelection: true
|
withSelection: true
|
||||||
|
@ -572,14 +572,14 @@ export default class ChatContextMenu {
|
||||||
notDirect: () => true,
|
notDirect: () => true,
|
||||||
localName: 'emojis'
|
localName: 'emojis'
|
||||||
}, {
|
}, {
|
||||||
regularText: this.sponsoredMessage?.sponsor_info,
|
regularText: this.sponsoredMessage?.sponsor_info ? wrapEmojiText(this.sponsoredMessage.sponsor_info) : undefined,
|
||||||
separator: true,
|
separator: true,
|
||||||
multiline: true,
|
multiline: true,
|
||||||
onClick: () => copyTextToClipboard(this.sponsoredMessage.sponsor_info),
|
onClick: () => copyTextToClipboard(this.sponsoredMessage.sponsor_info),
|
||||||
verify: () => !!this.sponsoredMessage.sponsor_info,
|
verify: () => !!this.sponsoredMessage.sponsor_info,
|
||||||
isSponsored: true
|
isSponsored: true
|
||||||
}, {
|
}, {
|
||||||
regularText: this.sponsoredMessage?.additional_info,
|
regularText: this.sponsoredMessage?.additional_info ? wrapEmojiText(this.sponsoredMessage.additional_info) : undefined,
|
||||||
separator: true,
|
separator: true,
|
||||||
multiline: true,
|
multiline: true,
|
||||||
onClick: () => copyTextToClipboard(this.sponsoredMessage.additional_info),
|
onClick: () => copyTextToClipboard(this.sponsoredMessage.additional_info),
|
||||||
|
|
|
@ -60,7 +60,7 @@ export default class EmojiHelper extends AutocompleteHelper {
|
||||||
emojis = emojis.slice(0, 80);
|
emojis = emojis.slice(0, 80);
|
||||||
|
|
||||||
if(emojis.length) {
|
if(emojis.length) {
|
||||||
this.list.innerHTML = '';
|
this.list.replaceChildren();
|
||||||
emojis.forEach((emoji) => {
|
emojis.forEach((emoji) => {
|
||||||
appendEmoji(emoji, this.list, false, true);
|
appendEmoji(emoji, this.list, false, true);
|
||||||
});
|
});
|
||||||
|
|
|
@ -59,7 +59,7 @@ export namespace MessageRender {
|
||||||
|
|
||||||
const postViewsSpan = document.createElement('span');
|
const postViewsSpan = document.createElement('span');
|
||||||
postViewsSpan.classList.add('post-views');
|
postViewsSpan.classList.add('post-views');
|
||||||
postViewsSpan.innerHTML = formatNumber(message.views, 1);
|
postViewsSpan.textContent = formatNumber(message.views, 1);
|
||||||
|
|
||||||
const channelViews = document.createElement('i');
|
const channelViews = document.createElement('i');
|
||||||
channelViews.classList.add('tgico-channelviews', 'time-icon');
|
channelViews.classList.add('tgico-channelviews', 'time-icon');
|
||||||
|
|
|
@ -144,7 +144,8 @@ export default class PinnedMessageBorder {
|
||||||
if(this.count !== count) {
|
if(this.count !== count) {
|
||||||
this.wrapper.className = BASE_CLASS + '-wrapper-1';
|
this.wrapper.className = BASE_CLASS + '-wrapper-1';
|
||||||
this.border.classList.remove(BASE_CLASS + '-mask');
|
this.border.classList.remove(BASE_CLASS + '-mask');
|
||||||
this.wrapper.innerHTML = this.wrapper.style.cssText = '';
|
this.wrapper.replaceChildren();
|
||||||
|
this.wrapper.style.cssText = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.border;
|
return this.border;
|
||||||
|
|
|
@ -49,10 +49,6 @@ export default class RepliesElement extends HTMLElement {
|
||||||
public render() {
|
public render() {
|
||||||
const replies = this.message.replies;
|
const replies = this.message.replies;
|
||||||
|
|
||||||
/* if(this.firstChild) {
|
|
||||||
this.innerHTML = '';
|
|
||||||
} */
|
|
||||||
|
|
||||||
if(this.type === 'footer') {
|
if(this.type === 'footer') {
|
||||||
let leftPart: HTMLElement;
|
let leftPart: HTMLElement;
|
||||||
if(this.firstElementChild) {
|
if(this.firstElementChild) {
|
||||||
|
@ -61,7 +57,7 @@ export default class RepliesElement extends HTMLElement {
|
||||||
|
|
||||||
if(replies?.recent_repliers) {
|
if(replies?.recent_repliers) {
|
||||||
if(leftPart && !leftPart.classList.contains('replies-footer-avatars')) {
|
if(leftPart && !leftPart.classList.contains('replies-footer-avatars')) {
|
||||||
this.innerHTML = '';
|
this.replaceChildren();
|
||||||
leftPart = null;
|
leftPart = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,8 +70,7 @@ export function appendEmoji(emoji: string, container?: HTMLElement, prepend = fa
|
||||||
|
|
||||||
if(spanEmoji.children.length > 1) {
|
if(spanEmoji.children.length > 1) {
|
||||||
const first = spanEmoji.firstElementChild;
|
const first = spanEmoji.firstElementChild;
|
||||||
spanEmoji.innerHTML = '';
|
spanEmoji.replaceChildren(first);
|
||||||
spanEmoji.append(first);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(spanEmoji.firstElementChild?.tagName === 'IMG') {
|
if(spanEmoji.firstElementChild?.tagName === 'IMG') {
|
||||||
|
|
|
@ -37,10 +37,8 @@ import wrapPeerTitle from './wrappers/peerTitle';
|
||||||
import wrapTopicNameButton from './wrappers/topicNameButton';
|
import wrapTopicNameButton from './wrappers/topicNameButton';
|
||||||
|
|
||||||
const setText = (text: Parameters<typeof setInnerHTML>[1], row: Row) => {
|
const setText = (text: Parameters<typeof setInnerHTML>[1], row: Row) => {
|
||||||
// fastRaf(() => {
|
setInnerHTML(row.title, text || undefined);
|
||||||
setInnerHTML(row.title, text || '');
|
|
||||||
row.container.style.display = text ? '' : 'none';
|
row.container.style.display = text ? '' : 'none';
|
||||||
// });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default class PeerProfile {
|
export default class PeerProfile {
|
||||||
|
|
|
@ -354,7 +354,7 @@ export default class PollElement extends HTMLElement {
|
||||||
const time = Date.now();
|
const time = Date.now();
|
||||||
const percents = (closeTime - time) / period;
|
const percents = (closeTime - time) / period;
|
||||||
const timeLeft = (closeTime - time) / 1000 + 1 | 0;
|
const timeLeft = (closeTime - time) / 1000 + 1 | 0;
|
||||||
timeLeftDiv.innerHTML = toHHMMSS(timeLeft);
|
timeLeftDiv.textContent = toHHMMSS(timeLeft);
|
||||||
|
|
||||||
if(timeLeft <= 5) {
|
if(timeLeft <= 5) {
|
||||||
timeLeftDiv.style.color = '#ee545c';
|
timeLeftDiv.style.color = '#ee545c';
|
||||||
|
@ -368,7 +368,7 @@ export default class PollElement extends HTMLElement {
|
||||||
|
|
||||||
if(time >= closeTime) {
|
if(time >= closeTime) {
|
||||||
clearInterval(this.quizInterval);
|
clearInterval(this.quizInterval);
|
||||||
timeLeftDiv.innerHTML = '';
|
timeLeftDiv.replaceChildren();
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
circle.style.strokeDashoffset = circumference;
|
circle.style.strokeDashoffset = circumference;
|
||||||
this.quizInterval = 0;
|
this.quizInterval = 0;
|
||||||
|
|
|
@ -22,7 +22,7 @@ export type PopupPeerOptions = Omit<PopupOptions, 'buttons' | 'title'> & Partial
|
||||||
titleLangKey: LangPackKey,
|
titleLangKey: LangPackKey,
|
||||||
titleLangArgs: any[],
|
titleLangArgs: any[],
|
||||||
noTitle: boolean,
|
noTitle: boolean,
|
||||||
description: string | DocumentFragment,
|
description: Parameters<typeof setInnerHTML>[1],
|
||||||
descriptionLangKey: LangPackKey,
|
descriptionLangKey: LangPackKey,
|
||||||
descriptionLangArgs: any[],
|
descriptionLangArgs: any[],
|
||||||
buttons: Array<PopupPeerButton>,
|
buttons: Array<PopupPeerButton>,
|
||||||
|
|
|
@ -132,8 +132,7 @@ export default class PrivacySection {
|
||||||
takeOut: (newPeerIds) => {
|
takeOut: (newPeerIds) => {
|
||||||
_peerIds.length = 0;
|
_peerIds.length = 0;
|
||||||
_peerIds.push(...newPeerIds);
|
_peerIds.push(...newPeerIds);
|
||||||
exception.row.subtitle.innerHTML = '';
|
exception.row.subtitle.replaceChildren(...this.generateStr(this.splitPeersByType(newPeerIds)));
|
||||||
exception.row.subtitle.append(...this.generateStr(this.splitPeersByType(newPeerIds)));
|
|
||||||
},
|
},
|
||||||
selectedPeerIds: _peerIds
|
selectedPeerIds: _peerIds
|
||||||
});
|
});
|
||||||
|
@ -161,7 +160,7 @@ export default class PrivacySection {
|
||||||
arr.push(...from.chats.map((id) => id.toPeerId(true)));
|
arr.push(...from.chats.map((id) => id.toPeerId(true)));
|
||||||
this.peerIds[k] = arr;
|
this.peerIds[k] = arr;
|
||||||
const s = this.exceptions.get(k).row.subtitle;
|
const s = this.exceptions.get(k).row.subtitle;
|
||||||
s.innerHTML = '';
|
s.replaceChildren();
|
||||||
s.append(...this.generateStr(from));
|
s.append(...this.generateStr(from));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -224,7 +223,7 @@ export default class PrivacySection {
|
||||||
const caption = this.options.captions[this.type];
|
const caption = this.options.captions[this.type];
|
||||||
const captionElement = this.radioSection.caption;
|
const captionElement = this.radioSection.caption;
|
||||||
if(!caption) {
|
if(!caption) {
|
||||||
captionElement.innerHTML = '';
|
captionElement.replaceChildren();
|
||||||
} else if(caption instanceof HTMLElement) {
|
} else if(caption instanceof HTMLElement) {
|
||||||
replaceContent(captionElement, caption);
|
replaceContent(captionElement, caption);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -36,7 +36,7 @@ export function setButtonLoader(elem: HTMLButtonElement, icon = 'check') {
|
||||||
putPreloader(elem);
|
putPreloader(elem);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
elem.innerHTML = '';
|
elem.replaceChildren();
|
||||||
elem.classList.add('tgico-' + icon);
|
elem.classList.add('tgico-' + icon);
|
||||||
elem.removeAttribute('disabled');
|
elem.removeAttribute('disabled');
|
||||||
};
|
};
|
||||||
|
|
|
@ -256,7 +256,7 @@ export class AppSidebarLeft extends SidebarSlider {
|
||||||
});
|
});
|
||||||
const t = document.createElement('span');
|
const t = document.createElement('span');
|
||||||
t.classList.add('btn-menu-footer-text');
|
t.classList.add('btn-menu-footer-text');
|
||||||
t.innerHTML = 'Telegram Web' + App.suffix + ' '/* ' alpha ' */ + App.versionFull;
|
t.textContent = 'Telegram Web' + App.suffix + ' '/* ' alpha ' */ + App.versionFull;
|
||||||
btnMenuFooter.append(t);
|
btnMenuFooter.append(t);
|
||||||
btnMenu.classList.add('has-footer');
|
btnMenu.classList.add('has-footer');
|
||||||
btnMenu.append(btnMenuFooter);
|
btnMenu.append(btnMenuFooter);
|
||||||
|
@ -549,7 +549,7 @@ export class AppSidebarLeft extends SidebarSlider {
|
||||||
});
|
});
|
||||||
searchSuper.load(true);
|
searchSuper.load(true);
|
||||||
|
|
||||||
helper.innerHTML = '';
|
helper.replaceChildren();
|
||||||
searchSuper.nav.classList.remove('hide');
|
searchSuper.nav.classList.remove('hide');
|
||||||
if(!value) {
|
if(!value) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ export default class AppAddMembersTab extends SliderSuperTab {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.nextBtn.classList.add('tgico-arrow_next');
|
this.nextBtn.classList.add('tgico-arrow_next');
|
||||||
this.nextBtn.innerHTML = '';
|
this.nextBtn.replaceChildren();
|
||||||
this.nextBtn.disabled = false;
|
this.nextBtn.disabled = false;
|
||||||
this.nextBtn.classList.toggle('is-visible', this.skippable);
|
this.nextBtn.classList.toggle('is-visible', this.skippable);
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,12 +74,9 @@ export default class AppBlockedUsersTab extends SliderSuperTab {
|
||||||
if(user.pFlags.bot) {
|
if(user.pFlags.bot) {
|
||||||
dom.lastMessageSpan.append('@' + username);
|
dom.lastMessageSpan.append('@' + username);
|
||||||
} else {
|
} else {
|
||||||
if(user.phone) dom.lastMessageSpan.innerHTML = formatUserPhone(user.phone);
|
if(user.phone) dom.lastMessageSpan.textContent = formatUserPhone(user.phone);
|
||||||
else dom.lastMessageSpan.append(username ? '@' + username : getUserStatusString(user));
|
else dom.lastMessageSpan.append(username ? '@' + username : getUserStatusString(user));
|
||||||
}
|
}
|
||||||
|
|
||||||
// dom.titleSpan.innerHTML = 'Raaid El Syed';
|
|
||||||
// dom.lastMessageSpan.innerHTML = '+1 234 567891';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
for(const peerId of this.peerIds) {
|
for(const peerId of this.peerIds) {
|
||||||
|
|
|
@ -10,23 +10,16 @@ import CheckboxField from '../../checkboxField';
|
||||||
import RadioField from '../../radioField';
|
import RadioField from '../../radioField';
|
||||||
import rootScope from '../../../lib/rootScope';
|
import rootScope from '../../../lib/rootScope';
|
||||||
import {IS_APPLE, IS_SAFARI} from '../../../environment/userAgent';
|
import {IS_APPLE, IS_SAFARI} from '../../../environment/userAgent';
|
||||||
import Row, {CreateRowFromCheckboxField} from '../../row';
|
import Row from '../../row';
|
||||||
import AppBackgroundTab from './background';
|
import AppBackgroundTab from './background';
|
||||||
import I18n, {i18n, LangPackKey, _i18n} from '../../../lib/langPack';
|
import I18n, {LangPackKey, _i18n} from '../../../lib/langPack';
|
||||||
import {attachClickEvent} from '../../../helpers/dom/clickEvent';
|
import {attachClickEvent} from '../../../helpers/dom/clickEvent';
|
||||||
import assumeType from '../../../helpers/assumeType';
|
import {BaseTheme} from '../../../layer';
|
||||||
import {BaseTheme, MessagesAllStickers, StickerSet} from '../../../layer';
|
|
||||||
import LazyLoadQueue from '../../lazyLoadQueue';
|
|
||||||
import PopupStickers from '../../popups/stickers';
|
|
||||||
import eachMinute from '../../../helpers/eachMinute';
|
import eachMinute from '../../../helpers/eachMinute';
|
||||||
import {SliderSuperTabEventable} from '../../sliderTab';
|
import {SliderSuperTabEventable} from '../../sliderTab';
|
||||||
import IS_GEOLOCATION_SUPPORTED from '../../../environment/geolocationSupport';
|
import IS_GEOLOCATION_SUPPORTED from '../../../environment/geolocationSupport';
|
||||||
import AppQuickReactionTab from './quickReaction';
|
|
||||||
import wrapEmojiText from '../../../lib/richTextProcessor/wrapEmojiText';
|
|
||||||
import {DEFAULT_THEME, State} from '../../../config/state';
|
import {DEFAULT_THEME, State} from '../../../config/state';
|
||||||
import wrapStickerSetThumb from '../../wrappers/stickerSetThumb';
|
import {generateSection} from '../../settingSection';
|
||||||
import wrapStickerToRow from '../../wrappers/stickerToRow';
|
|
||||||
import SettingSection, {generateSection} from '../../settingSection';
|
|
||||||
import {ScrollableX} from '../../scrollable';
|
import {ScrollableX} from '../../scrollable';
|
||||||
import wrapStickerEmoji from '../../wrappers/stickerEmoji';
|
import wrapStickerEmoji from '../../wrappers/stickerEmoji';
|
||||||
import {Theme} from '../../../layer';
|
import {Theme} from '../../../layer';
|
||||||
|
|
|
@ -265,9 +265,8 @@ export default class AppPrivacyAndSecurityTab extends SliderSuperTabEventable {
|
||||||
const disallowLength = details.disallowPeers.users.length + details.disallowPeers.chats.length;
|
const disallowLength = details.disallowPeers.users.length + details.disallowPeers.chats.length;
|
||||||
const allowLength = details.allowPeers.users.length + details.allowPeers.chats.length;
|
const allowLength = details.allowPeers.users.length + details.allowPeers.chats.length;
|
||||||
|
|
||||||
row.subtitle.innerHTML = '';
|
|
||||||
const s = i18n(langKey);
|
const s = i18n(langKey);
|
||||||
row.subtitle.append(s);
|
row.subtitle.replaceChildren(s);
|
||||||
if(disallowLength || allowLength) {
|
if(disallowLength || allowLength) {
|
||||||
row.subtitle.append(` (${[-disallowLength, allowLength ? '+' + allowLength : 0].filter(Boolean).join(', ')})`);
|
row.subtitle.append(` (${[-disallowLength, allowLength ? '+' + allowLength : 0].filter(Boolean).join(', ')})`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,7 @@ export default class AppChatTypeTab extends SliderSuperTabEventable {
|
||||||
|
|
||||||
this.managers.appProfileManager.getChatInviteLink(this.chatId, true).then((link) => {
|
this.managers.appProfileManager.getChatInviteLink(this.chatId, true).then((link) => {
|
||||||
toggle();
|
toggle();
|
||||||
linkRow.title.innerHTML = link;
|
linkRow.title.textContent = link;
|
||||||
// revoked = true;
|
// revoked = true;
|
||||||
// onChange();
|
// onChange();
|
||||||
});
|
});
|
||||||
|
|
|
@ -113,9 +113,8 @@ export default class AppEditContactTab extends SliderSuperTab {
|
||||||
const profileNameDiv = document.createElement('div');
|
const profileNameDiv = document.createElement('div');
|
||||||
profileNameDiv.classList.add('profile-name');
|
profileNameDiv.classList.add('profile-name');
|
||||||
profileNameDiv.append(new PeerTitle({
|
profileNameDiv.append(new PeerTitle({
|
||||||
peerId: peerId
|
peerId
|
||||||
}).element);
|
}).element);
|
||||||
// profileNameDiv.innerHTML = 'Karen Stanford';
|
|
||||||
|
|
||||||
const profileSubtitleDiv = document.createElement('div');
|
const profileSubtitleDiv = document.createElement('div');
|
||||||
profileSubtitleDiv.classList.add('profile-subtitle');
|
profileSubtitleDiv.classList.add('profile-subtitle');
|
||||||
|
|
|
@ -79,7 +79,7 @@ export default class AppGifsTab extends SliderSuperTab {
|
||||||
|
|
||||||
public onCloseAfterTimeout() {
|
public onCloseAfterTimeout() {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.gifsDiv.innerHTML = '';
|
this.gifsDiv.replaceChildren();
|
||||||
animationIntersector.checkAnimations(undefined, ANIMATIONGROUP);
|
animationIntersector.checkAnimations(undefined, ANIMATIONGROUP);
|
||||||
this.inputSearch.remove();
|
this.inputSearch.remove();
|
||||||
return super.onCloseAfterTimeout();
|
return super.onCloseAfterTimeout();
|
||||||
|
@ -110,7 +110,7 @@ export default class AppGifsTab extends SliderSuperTab {
|
||||||
this.searchPromise = null;
|
this.searchPromise = null;
|
||||||
this.nextOffset = next_offset;
|
this.nextOffset = next_offset;
|
||||||
if(newSearch) {
|
if(newSearch) {
|
||||||
this.gifsDiv.innerHTML = '';
|
this.gifsDiv.replaceChildren();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(results.length) {
|
if(results.length) {
|
||||||
|
|
|
@ -91,7 +91,7 @@ export default class AppStickersTab extends SliderSuperTab {
|
||||||
}
|
}
|
||||||
|
|
||||||
public onCloseAfterTimeout() {
|
public onCloseAfterTimeout() {
|
||||||
this.setsDiv.innerHTML = '';
|
this.setsDiv.replaceChildren();
|
||||||
animationIntersector.checkAnimations(undefined, 'STICKERS-SEARCH');
|
animationIntersector.checkAnimations(undefined, 'STICKERS-SEARCH');
|
||||||
return super.onCloseAfterTimeout();
|
return super.onCloseAfterTimeout();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
export default function replaceContent(elem: HTMLElement, node: string | Node) {
|
export default function replaceContent(elem: HTMLElement, node: string | Node) {
|
||||||
if(typeof(node) === 'string') {
|
if(typeof(node) === 'string') {
|
||||||
elem.innerHTML = node;
|
elem.textContent = node;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ export default function setInnerHTML(elem: Element, html: string | DocumentFragm
|
||||||
setDirection(elem);
|
setDirection(elem);
|
||||||
if(typeof(html) === 'string') {
|
if(typeof(html) === 'string') {
|
||||||
if(!html) elem.replaceChildren();
|
if(!html) elem.replaceChildren();
|
||||||
else elem.innerHTML = html;
|
else elem.textContent = html;
|
||||||
} else {
|
} else {
|
||||||
elem.replaceChildren(html);
|
elem.replaceChildren(html);
|
||||||
}
|
}
|
||||||
|
|
|
@ -312,14 +312,16 @@ export default class VideoPlayer extends ControlsHover {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected setBtnMenuToggle() {
|
protected setBtnMenuToggle() {
|
||||||
const buttons: Parameters<typeof ButtonMenuSync>[0]['buttons'] = VideoPlayer.PLAYBACK_RATES.map((rate, idx) => {
|
const buttons = VideoPlayer.PLAYBACK_RATES.map((rate, idx) => {
|
||||||
return {
|
const buttonOptions: Parameters<typeof ButtonMenuSync>[0]['buttons'][0] = {
|
||||||
// icon: VideoPlayer.PLAYBACK_RATES_ICONS[idx],
|
// icon: VideoPlayer.PLAYBACK_RATES_ICONS[idx],
|
||||||
regularText: rate + 'x',
|
regularText: rate + 'x',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
appMediaPlaybackController.playbackRate = rate;
|
appMediaPlaybackController.playbackRate = rate;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return buttonOptions;
|
||||||
});
|
});
|
||||||
const btnMenu = ButtonMenuSync({buttons});
|
const btnMenu = ButtonMenuSync({buttons});
|
||||||
btnMenu.classList.add('top-left');
|
btnMenu.classList.add('top-left');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user