Quellcode durchsuchen

Merge pull request #4662 from pixelfed/staging

Update profile embed, fix resize
daniel vor 1 Jahr
Ursprung
Commit
b91d263237
2 geänderte Dateien mit 11 neuen und 2 gelöschten Zeilen
  1. 1 0
      CHANGELOG.md
  2. 10 2
      resources/views/profile/embed.blade.php

+ 1 - 0
CHANGELOG.md

@@ -13,6 +13,7 @@
 - Update StoryApiV1Controller, add viewers route to view story viewers ([941736ce](https://github.com/pixelfed/pixelfed/commit/941736ce))
 - Update NotificationService, improve cache warming query ([2496386d](https://github.com/pixelfed/pixelfed/commit/2496386d))
 - Update StatusService, hydrate accounts on request instead of caching them along with status objects ([223661ec](https://github.com/pixelfed/pixelfed/commit/223661ec))
+- Update profile embed, fix resize ([dc23c21d](https://github.com/pixelfed/pixelfed/commit/dc23c21d))
 -  ([](https://github.com/pixelfed/pixelfed/commit/))
 
 ## [v0.11.9 (2023-08-21)](https://github.com/pixelfed/pixelfed/compare/v0.11.8...v0.11.9)

+ 10 - 2
resources/views/profile/embed.blade.php

@@ -73,7 +73,9 @@
   <script type="text/javascript" src="{{mix('js/manifest.js')}}"></script>
   <script type="text/javascript" src="{{mix('js/vendor.js')}}"></script>
   <script type="text/javascript" src="{{mix('js/app.js')}}"></script>
-  <script type="text/javascript">window.addEventListener("message",e=>{const t=e.data||{};window.parent&&"setHeight"===t.type&&window.parent.postMessage({type:"setHeight",id:t.id,height:document.getElementsByTagName("html")[0].scrollHeight},"*")});</script>
+  <script type="text/javascript">
+      window.addEventListener("message", e=>{const t=e.data||{};});
+  </script>
   <script type="text/javascript">document.querySelectorAll('.caption-container a').forEach(function(i) {i.setAttribute('target', '_blank');});</script>
   <script type="text/javascript">
     document.querySelectorAll('.prettyCount').forEach(function(i) {
@@ -103,7 +105,13 @@
 			</div>`;
 			parent.append(el);
   		})
-  	});
+  	})
+    .finally(() => {
+        window.parent.postMessage({type:"setHeight",id:0,height:document.getElementsByTagName("html")[0].scrollHeight},"*");
+        setTimeout(() => {
+            window.parent.postMessage({type:"setHeight",id:0,height:document.getElementsByTagName("html")[0].scrollHeight},"*");
+        }, 5000);
+    })
   </script>
 </body>
 </html>