changeset 685:b05376c7ece8

Add confirmation for changing entry's compo_id.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 09 Nov 2014 19:24:18 +0200
parents 3be02474f849
children 8730bffcffd4
files admin.js
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/admin.js	Sun Nov 09 19:01:43 2014 +0200
+++ b/admin.js	Sun Nov 09 19:24:18 2014 +0200
@@ -395,8 +395,21 @@
       setTimeout("refreshCMEntry("+ id +");", 50);
   }
 
+  var mcb_ok = function(data)
+  {
+    jsSendPOSTRequest("action=update&type=entry&id="+id+"&"+args, msuccess);
+  }
+  var mcb_cancel = function(data)
+  {
+  }
+
   if (args != "")
-    jsSendPOSTRequest("action=update&type=entry&id="+id+"&"+args, msuccess);
+  {
+    if (cid != compo_id)
+      jsConfirmBox("Are you sure you want to change entry #"+id+"'s compo_id from "+cid+" to "+compo_id+"?", mcb_ok, mcb_cancel);
+    else
+      mcb_ok();
+  }
 }