diff --git a/web/js/opensocial-util.js b/web/js/opensocial-util.js index c97abdf..55729f1 100644 --- a/web/js/opensocial-util.js +++ b/web/js/opensocial-util.js @@ -1,3 +1 @@ - -var IframeModalBox=Class.create();IframeModalBox.prototype={modal:null,modalContents:null,modalIframe:null,closeCallback:null,initialize:function(id){this.modal=$(id);this.modalContents=$(id+'_contents');this.modalIframe=this.modalContents.getElementsByTagName('iframe')[0];},open:function(url,close_callback){this.closeCallback=null;if(close_callback){this.closeCallback=close_callback;} -var pos=getCenterMuchScreen(this.modalContents);this.modalContents.setStyle(pos);this.modalIframe.src=url;new Effect.Appear(this.modal,{from:0,to:0.7});new Effect.Appear(this.modalContents,{from:0,to:1.0});},close:function(callback_params){Element.hide(this.modal);Element.hide(this.modalContents);if(this.closeCallback){this.closeCallback(callback_params);}}} \ No newline at end of file +var IframeModalBox=Class.create(); IframeModalBox.prototype={modal:null,modalContents:null,modalIframe:null,closeCallback:null,initialize:function(a){this.modal=$(a);this.modalContents=$(a+"_contents");this.modalIframe=this.modalContents.getElementsByTagName("iframe")[0]},open:function(a,b){this.closeCallback=null;if(b)this.closeCallback=b;this.modalContents.setStyle(getCenterMuchScreen(this.modalContents));this.modalIframe.src=a;new Effect.Appear(this.modal,{from:0,to:0.7});new Effect.Appear(this.modalContents,{from:0,to:1})},close:function(a){Element.hide(this.modal); Element.hide(this.modalContents);this.closeCallback&&this.closeCallback(a);this.clear()},clear:function(){this.modalIframe.contentDocument.open();this.modalIframe.contentDocument.close()}}; diff --git a/web/js/opensocial-util.js.src b/web/js/opensocial-util.js.src index 8c5313b..774a211 100644 --- a/web/js/opensocial-util.js.src +++ b/web/js/opensocial-util.js.src @@ -29,5 +29,11 @@ IframeModalBox.prototype = { if (this.closeCallback) { this.closeCallback(callback_params); } + this.clear(); + }, + + clear: function() { + this.modalIframe.contentDocument.open(); + this.modalIframe.contentDocument.close(); } }