add method to open modal dialog
This commit is contained in:
parent
c865e62dbf
commit
f57e4aca8f
1 changed files with 29 additions and 0 deletions
|
|
@ -418,6 +418,35 @@ WebGUI.Admin.prototype.requestHelper
|
||||||
var ajax = YAHOO.util.Connect.asyncRequest( 'GET', url, callback );
|
var ajax = YAHOO.util.Connect.asyncRequest( 'GET', url, callback );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* openModalDialog( url, width, height )
|
||||||
|
* Open a modal dialog with an iframe containing the given URL.
|
||||||
|
* The page inside the iframe must eventually close the dialog using:
|
||||||
|
* window.parent.admin.closeModalDialog();
|
||||||
|
*/
|
||||||
|
WebGUI.Admin.prototype.openModalDialog
|
||||||
|
= function ( url, width, height ) {
|
||||||
|
if ( this.modalDialog ) {
|
||||||
|
return; // Can't have more than one open
|
||||||
|
}
|
||||||
|
|
||||||
|
var dialog = YAHOO.widget.Panel( 'adminModalDialog', {
|
||||||
|
"width" : width,
|
||||||
|
"height" : height,
|
||||||
|
fixedcenter : true,
|
||||||
|
constraintoviewport : true,
|
||||||
|
underlay : "shadow",
|
||||||
|
modal : true,
|
||||||
|
close : false,
|
||||||
|
visible : true,
|
||||||
|
draggable : false
|
||||||
|
} );
|
||||||
|
dialog.setBody( '<iframe src="' + url + '" width="' + width + '" height="' + height '"></iframe>' );
|
||||||
|
dialog.render( document.body );
|
||||||
|
|
||||||
|
this.modalDialog = dialog;
|
||||||
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* WebGUI.Admin.LocationBar
|
* WebGUI.Admin.LocationBar
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue