Add loader animation to iframe src change

This commit is contained in:
Nathan Gray 2014-01-18 16:55:16 +00:00
parent 64fd8ec86b
commit ad735932f1
2 changed files with 28 additions and 1 deletions

View File

@ -111,7 +111,24 @@ var et2_iframe = et2_valueWidget.extend(
set_src: function(_value) {
if(_value.trim() != "")
{
this.htmlNode.attr("src", _value);
if(_value.trim() == 'about:blank')
{
this.htmlNode.attr("src", _value);
}
else
{
// Load the new page, but display a loader
var loader = $j('<div class="et2_iframe loading"/>');
this.htmlNode
.before(loader);
window.setTimeout(jQuery.proxy(function() {
this.htmlNode.attr("src", _value)
.one('load',function() {
loader.remove();
});
},this),0);
}
}
},

View File

@ -724,6 +724,16 @@ table.et2_grid {
table.et2_grid tbody.ui-sortable > tr:not(.th) {
cursor: ns-resize;
}
/**
* irame & loader
*/
.et2_iframe.loading {
position: absolute;
width: 100%;
height: 100%;
}
/**
* Create some spacing for widgets inside labels
*/