From 4b25065565bcbb3da47f5518ae50d73b1acd3e55 Mon Sep 17 00:00:00 2001
From: Will <hortonw@mir.wustl.edu>
Date: Sat, 4 Jun 2016 17:06:06 -0500
Subject: [PATCH] XNAT-4288: Route popup to an auto-closing response window.
 (Hack hack hack!)

---
 .../webapp/xnat-templates/screens/JS_Return_Autoclose.vm   | 7 +++++++
 .../screens/XDATScreen_edit_xnat_investigatorData.vm       | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)
 create mode 100644 src/main/webapp/xnat-templates/screens/JS_Return_Autoclose.vm

diff --git a/src/main/webapp/xnat-templates/screens/JS_Return_Autoclose.vm b/src/main/webapp/xnat-templates/screens/JS_Return_Autoclose.vm
new file mode 100644
index 00000000..a3d3dc1b
--- /dev/null
+++ b/src/main/webapp/xnat-templates/screens/JS_Return_Autoclose.vm
@@ -0,0 +1,7 @@
+#set ($template = $data.getTemplateInfo())
+$!template.setLayoutTemplate("ScreenOnly.vm")
+<!-- only useful for popups. -->
+<script>
+    window.opener.location.reload();
+    window.close();
+</script>
diff --git a/src/main/webapp/xnat-templates/screens/XDATScreen_edit_xnat_investigatorData.vm b/src/main/webapp/xnat-templates/screens/XDATScreen_edit_xnat_investigatorData.vm
index 7f1ae0aa..50021e2b 100644
--- a/src/main/webapp/xnat-templates/screens/XDATScreen_edit_xnat_investigatorData.vm
+++ b/src/main/webapp/xnat-templates/screens/XDATScreen_edit_xnat_investigatorData.vm
@@ -59,7 +59,7 @@ $page.setVlinkColor($ui.vlink)
 		</TD>
 	</TR>
 	#xdatEditProps($item $edit_screen)
-	<input type="hidden" name="destination" value="$!destination"/>
+	<input type="hidden" name="destination" value="JS_Return_Autoclose.vm"/>
 	<TR><TD COLSPAN=2 ALIGN=center><input type="submit" name="eventSubmit_doSetup" value="Submit"/></TD></TR>
 </table>
 
@@ -67,4 +67,4 @@ $page.setVlinkColor($ui.vlink)
 			#hideFormJustification()
 
 </form>
-</p>
\ No newline at end of file
+</p>
-- 
GitLab