Conditions | 5 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | (function() { |
||
13 | function updateIframeHash() { // see https://gist.github.com/manufitoussi/7529fa882ff0b737f257 |
||
14 | if(iframe.contentWindow.location.host !== "") { |
||
15 | // iframe already loaded. |
||
16 | iframe.contentWindow.location.hash = window.location.hash; |
||
17 | } else { |
||
18 | // iframe is just starting. |
||
19 | var newHash = window.location.hash; |
||
20 | var srcStr = iframe.getAttribute('src'); |
||
21 | var words = srcStr.split('#'); |
||
22 | var href = words[0]; |
||
23 | var newSrc = href + newHash; |
||
24 | iframe.setAttribute('src', newSrc); |
||
25 | } |
||
26 | }; |
||
27 | |||
36 |