attempt to support redirecting to the given url instead of just refreshing

pull/1857/head
Isaac Connor 2017-03-27 13:13:08 -04:00
parent 8ef7a708bd
commit 7b63461517
2 changed files with 23 additions and 11 deletions

View File

@ -186,10 +186,13 @@ function refreshWindow()
window.location.reload( true );
}
function refreshParentWindow()
{
if ( window.opener )
function refreshParentWindow() {
if ( window.opener ) {
if ( refreshParent == true )
window.opener.location.reload( true );
else
window.opener.location.href = refreshParent;
}
}
//Shows a message if there is an error in the streamObj or the stream doesn't exist. Returns true if error, false otherwise.
@ -270,20 +273,18 @@ function configureDeleteButton( element )
form.deleteBtn.disabled = !checked;
}
function confirmDelete( message )
{
function confirmDelete( message ) {
return( confirm( message?message:'Are you sure you wish to delete?' ) );
}
if ( refreshParent )
{
if ( refreshParent ) {
refreshParentWindow();
}
if ( focusWindow )
{
if ( focusWindow ) {
windowToFront();
}
window.addEvent( 'domready', checkSize);
function convertLabelFormat(LabelFormat, monitorName){

View File

@ -35,7 +35,18 @@ var canViewSystem = <?php echo canView('System' )?'true':'false' ?>;
var canEditGroups = <?php echo canEdit('Groups' )?'true':'false' ?>;
var refreshParent = <?php echo !empty($refreshParent)?'true':'false' ?>;
var refreshParent = <?php
if ( ! empty($refreshParent) ) {
if ( $refreshParent == true ) {
echo 'true';
return;
} else if ( $refreshParent ) {
echo "'$refreshParent'";
return;
}
}
echo 'false';
?>;
var focusWindow = <?php echo !empty($focusWindow)?'true':'false' ?>;