Revision: 981
http://openautomation.svn.sourceforge.net/openautomation/?rev=981&view=rev
Author: makki1
Date: 2012-08-22 18:20:23 +0000 (Wed, 22 Aug 2012)
Log Message:
-----------
Enable refresh for external iframes
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-08-21 13:35:54 UTC (rev 980)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-08-22 18:20:23 UTC (rev 981)
@@ -707,8 +707,23 @@
/* is possible to overload?!? */
/** ************************************************************************* */
function refreshAction( target, src ) {
- target.src = src + '&' + new Date().getTime();
+ /* Special treatment for (external) iframes:
+ * we need to clear it and reload it in another thread as otherwise stays
+ * blank for some targets/sites and src = src doesnt work anyway on external
+ * This creates though some "flickering" so we avoid to use it on images,
+ * internal iframes and others
+ */
+ var parenthost = window.location.protocol + "//" + window.location.host
+ if (target.nodeName == "IFRAME" && src.indexOf(parenthost) != 0) {
+ target.src = '';
+ setTimeout( function () {
+ target.src = src;
+ }, 0);
+ } else {
+ target.src = src + '&' + new Date().getTime();
+ }
}
+
function setupRefreshAction() {
var refresh = $(this).data('refresh');
if( refresh && refresh > 0 ) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|