Skip to content

Commit c55e0b7

Browse files
committed
Prevent jittering during editing
1 parent d48aa75 commit c55e0b7

File tree

1 file changed

+16
-32
lines changed

1 file changed

+16
-32
lines changed

editor.html

+16-32
Original file line numberDiff line numberDiff line change
@@ -1597,10 +1597,8 @@ <h1>Telegram Limits Editor</h1>
15971597
this.markDirty();
15981598
});
15991599

1600-
setTimeout(() => {
1601-
itemName.style.height = "5px";
1602-
itemName.style.height = (itemName.scrollHeight) + "px";
1603-
}, 0);
1600+
itemName.style.height = "5px";
1601+
itemName.style.height = (itemName.scrollHeight) + "px";
16041602

16051603
const itemHint = document.createElement('textarea');
16061604
itemHint.value = sectionLocale.items[item.id].hint || '';
@@ -1617,10 +1615,8 @@ <h1>Telegram Limits Editor</h1>
16171615
this.markDirty();
16181616
});
16191617

1620-
setTimeout(() => {
1621-
itemHint.style.height = "5px";
1622-
itemHint.style.height = (itemHint.scrollHeight) + "px";
1623-
}, 0);
1618+
itemHint.style.height = "5px";
1619+
itemHint.style.height = (itemHint.scrollHeight) + "px";
16241620

16251621
const itemContentContainer = document.createElement('div');
16261622
itemContentContainer.classList.add('item-content-container');
@@ -1643,10 +1639,8 @@ <h1>Telegram Limits Editor</h1>
16431639
this.markDirty();
16441640
});
16451641

1646-
setTimeout(() => {
1647-
itemContent.style.height = "5px";
1648-
itemContent.style.height = (itemContent.scrollHeight) + "px";
1649-
}, 0);
1642+
itemContent.style.height = "5px";
1643+
itemContent.style.height = (itemContent.scrollHeight) + "px";
16501644

16511645
const itemContentPremiumContainer = document.createElement('div');
16521646
itemContentPremiumContainer.classList.add('item-content-premium-container');
@@ -1673,10 +1667,8 @@ <h1>Telegram Limits Editor</h1>
16731667
this.markDirty();
16741668
});
16751669

1676-
setTimeout(() => {
1677-
itemContentPremium.style.height = "5px";
1678-
itemContentPremium.style.height = (itemContentPremium.scrollHeight) + "px";
1679-
}, 0);
1670+
itemContentPremium.style.height = "5px";
1671+
itemContentPremium.style.height = (itemContentPremium.scrollHeight) + "px";
16801672

16811673
const idContainer = document.createElement('div');
16821674
idContainer.classList.add('id-container');
@@ -1780,10 +1772,8 @@ <h1>Telegram Limits Editor</h1>
17801772
idContainer.textContent = itemId;
17811773
});
17821774

1783-
setTimeout(() => {
1784-
newItemName.style.height = "5px";
1785-
newItemName.style.height = (newItemName.scrollHeight) + "px";
1786-
}, 0);
1775+
newItemName.style.height = "5px";
1776+
newItemName.style.height = (newItemName.scrollHeight) + "px";
17871777

17881778
const newItemHint = document.createElement('textarea');
17891779
newItemHint.placeholder = 'Hint';
@@ -1796,10 +1786,8 @@ <h1>Telegram Limits Editor</h1>
17961786
newItemHint.style.height = (newItemHint.scrollHeight) + "px";
17971787
});
17981788

1799-
setTimeout(() => {
1800-
newItemHint.style.height = "5px";
1801-
newItemHint.style.height = (newItemHint.scrollHeight) + "px";
1802-
}, 0);
1789+
newItemHint.style.height = "5px";
1790+
newItemHint.style.height = (newItemHint.scrollHeight) + "px";
18031791

18041792
const newItemContent = document.createElement('textarea');
18051793
newItemContent.placeholder = 'Limit Description';
@@ -1812,10 +1800,8 @@ <h1>Telegram Limits Editor</h1>
18121800
newItemContent.style.height = (newItemContent.scrollHeight) + "px";
18131801
});
18141802

1815-
setTimeout(() => {
1816-
newItemContent.style.height = "5px";
1817-
newItemContent.style.height = (newItemContent.scrollHeight) + "px";
1818-
}, 0);
1803+
newItemContent.style.height = "5px";
1804+
newItemContent.style.height = (newItemContent.scrollHeight) + "px";
18191805

18201806
const newItemContentPremiumContainer = document.createElement('div');
18211807
newItemContentPremiumContainer.classList.add('item-content-premium-container');
@@ -1837,10 +1823,8 @@ <h1>Telegram Limits Editor</h1>
18371823
newItemContentPremium.style.height = (newItemContentPremium.scrollHeight) + "px";
18381824
});
18391825

1840-
setTimeout(() => {
1841-
newItemContentPremium.style.height = "5px";
1842-
newItemContentPremium.style.height = (newItemContentPremium.scrollHeight) + "px";
1843-
}, 0);
1826+
newItemContentPremium.style.height = "5px";
1827+
newItemContentPremium.style.height = (newItemContentPremium.scrollHeight) + "px";
18441828

18451829
addItemPanelRow.appendChild(idContainer);
18461830

0 commit comments

Comments
 (0)