Browse Source

temporary fixes

master
Eduard Kuzmenko 3 years ago
parent
commit
7b16d17d41
  1. 6
      src/components/poll.ts
  2. 7
      src/components/sidebarRight/tabs/stickers.ts
  3. 2
      src/helpers/dom/documentFragmentToHTML.ts

6
src/components/poll.ts

@ -274,7 +274,7 @@ export default class PollElement extends HTMLElement { @@ -274,7 +274,7 @@ export default class PollElement extends HTMLElement {
${multipleSelect}
</div>
<div class="poll-answer-percents"></div>
<div class="poll-answer-text">${RichTextProcessor.wrapEmojiText(answer.text)}</div>
<div class="poll-answer-text"></div>
<svg version="1.1" class="poll-line" style="display: none;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 485.9 35" xml:space="preserve">
<use href="#poll-line"></use>
</svg>
@ -293,6 +293,10 @@ export default class PollElement extends HTMLElement { @@ -293,6 +293,10 @@ export default class PollElement extends HTMLElement {
setInnerHTML(this.firstElementChild, RichTextProcessor.wrapEmojiText(poll.question));
Array.from(this.querySelectorAll('.poll-answer-text')).forEach((el, idx) => {
setInnerHTML(el, RichTextProcessor.wrapEmojiText(poll.answers[idx].text));
});
this.descDiv = this.firstElementChild.nextElementSibling as HTMLElement;
this.typeDiv = this.descDiv.firstElementChild as HTMLElement;
this.avatarsDiv = this.descDiv.lastElementChild as HTMLElement;

7
src/components/sidebarRight/tabs/stickers.ts

@ -19,6 +19,7 @@ import { i18n } from "../../../lib/langPack"; @@ -19,6 +19,7 @@ import { i18n } from "../../../lib/langPack";
import findUpClassName from "../../../helpers/dom/findUpClassName";
import { attachClickEvent } from "../../../helpers/dom/clickEvent";
import forEachReverse from "../../../helpers/array/forEachReverse";
import setInnerHTML from "../../../helpers/dom/setInnerHTML";
export default class AppStickersTab extends SliderSuperTab {
private inputSearch: InputSearch;
@ -98,9 +99,9 @@ export default class AppStickersTab extends SliderSuperTab { @@ -98,9 +99,9 @@ export default class AppStickersTab extends SliderSuperTab {
const details = document.createElement('div');
details.classList.add('sticker-set-details');
details.innerHTML = `
<div class="sticker-set-name">${RichTextProcessor.wrapEmojiText(set.title)}</div>
`;
details.innerHTML = `<div class="sticker-set-name"></div>`;
setInnerHTML(details.firstElementChild, RichTextProcessor.wrapEmojiText(set.title));
const countDiv = document.createElement('div');
countDiv.classList.add('sticker-set-count');

2
src/helpers/dom/documentFragmentToHTML.ts

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
export default function documentFragmentToHTML(fragment: DocumentFragment) {
return Array.from(fragment.childNodes).map((node) => {
return node.nodeType === 3 ? node.textContent : (node as Element).outerHTML + '\n';
return node.nodeType === 3 ? node.textContent : (node as Element).outerHTML;
}).join('');
}

Loading…
Cancel
Save