|
86 | 86 | const txts = document.querySelectorAll('.scEditorFieldMarkerInputCell textarea');
|
87 | 87 | if (txts.length === 0) return;
|
88 | 88 |
|
89 |
| - const style = document.createElement('style'); |
90 |
| - style.innerHTML = ` |
| 89 | + if (!document.getElementById('fixInputCellTextArea')) { |
| 90 | + const style = document.createElement('style'); |
| 91 | + style.id = 'fixInputCellTextArea'; |
| 92 | + style.innerHTML = ` |
91 | 93 | .monospace-font {font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;}
|
92 | 94 | `;
|
93 |
| - document.querySelector('body').appendChild(style); |
| 95 | + document.querySelector('body').appendChild(style); |
| 96 | + } |
94 | 97 |
|
95 | 98 | txts.forEach((txt) => {
|
| 99 | + if (txt.classList.contains('monospace-font')) return; |
| 100 | + |
96 | 101 | txt.classList.add('monospace-font');
|
97 | 102 | txt.setAttribute('spellcheck', false);
|
98 | 103 |
|
|
204 | 209 | cursor: pointer;
|
205 | 210 | background: red;
|
206 | 211 | white-space: nowrap;
|
207 |
| - } |
208 |
| - `; |
| 212 | + }`; |
209 | 213 | }
|
210 | 214 |
|
211 | 215 | chrome.storage.sync.get('favorites', ({ favorites }) => {
|
212 | 216 | favorites = favorites || [];
|
213 |
| - favorites = favorites.sort((a, b) => (a.path > b.path ? 1 : -1)); |
| 217 | + if (favorites.length > 1) { |
| 218 | + favorites = favorites.sort((a, b) => (a.path > b.path ? 1 : -1)); |
| 219 | + } |
214 | 220 |
|
215 | 221 | const accInfo = document.querySelector('.sc-accountInformation');
|
216 | 222 | let fav = document.querySelector('#ChromeExtensionForSitecoreFavorites');
|
|
323 | 329 | if (location.pathname === '/sitecore/shell/Applications/Content%20Editor.aspx') {
|
324 | 330 | stretchColumn();
|
325 | 331 | scrollToItem();
|
326 |
| - fixInputCellTextArea(); |
327 | 332 | addFocusHeightOnElements();
|
328 | 333 |
|
329 | 334 | addBookmark();
|
| 335 | + setInterval(fixInputCellTextArea, 500); |
330 | 336 | setInterval(addBookmark, 500);
|
331 | 337 |
|
332 | 338 | setInterval(enlargeTreelist, 500);
|
|
0 commit comments