mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-03 21:14:46 +00:00
iframe now hidden and faded in when loaded, for browsers with postMessage capability
This commit is contained in:
parent
82158a49db
commit
ccfde52b08
2 changed files with 12 additions and 1 deletions
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
if(w.postMessage){
|
||||
function callback(e){
|
||||
f.style.opacity=1;
|
||||
|
||||
// Get the height from the passed data.
|
||||
var h = Number(e.data.replace( /.*fh=(\d+)(?:&|$)/, '$1' ) );
|
||||
if (!isNaN( h ) && h > 0 && h !== frame_height) {
|
||||
|
|
@ -30,7 +32,12 @@
|
|||
f.scrolling = 'no';
|
||||
f.src = w.wagtail.userbar_src;
|
||||
|
||||
// if postMessage is supported, hide iframe till it is loaded
|
||||
if(w.postMessage){
|
||||
f.style.opacity=0;
|
||||
}
|
||||
|
||||
t = d.getElementsByTagName('title')[0];
|
||||
t.parentNode.insertBefore(l, t.nextSibling);
|
||||
d.body.appendChild(f);
|
||||
d.body.appendChild(f);
|
||||
}(window,document));
|
||||
|
|
@ -7,4 +7,8 @@
|
|||
border:0;
|
||||
width:150px;
|
||||
height:300px;
|
||||
-webkit-transition: opacity 0.3s ease;
|
||||
-moz-transition: opacity 0.3s ease;
|
||||
-o-transition: opacity 0.3s ease;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
Loading…
Reference in a new issue