File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 7
7
<!-- Adds target=_blank to external links -->
8
8
$ ( 'a[href^="http://"], a[href^="https://"]' ) . not ( 'a[class*=internal]' ) . attr ( 'target' , '_blank' ) ;
9
9
} ) ;
10
+
11
+ // *** iFrame resize & scrolling support ***
12
+ // Send the current page href to the parent site (if found)
13
+ // Give up after 5 tries (for example, if viewing these pages
14
+ // by themselves, with no parent openshot.org iFrame
15
+ let messageAttempts = 0 ;
16
+ function trySendMessage ( ) {
17
+ messageAttempts ++ ;
18
+ if ( 'parentIFrame' in window ) {
19
+ const href = frameElement . contentWindow . location . href ;
20
+ const type = "document-loaded" ;
21
+ window . parentIFrame . sendMessage ( { href, type} ) ;
22
+ } else {
23
+ // If not, try again in one second
24
+ if ( messageAttempts < 5 ) {
25
+ setTimeout ( trySendMessage , 250 ) ;
26
+ }
27
+ }
28
+ }
29
+ trySendMessage ( ) ;
30
+
10
31
</ script >
11
32
{% endblock %}
You can’t perform that action at this time.
0 commit comments