summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-04-09 17:17:00 -0400
committerJules Laplace <jules@okfoc.us>2015-04-09 17:17:00 -0400
commit7b7ac014579bafdb16e91a98f995f4fa7f55b4f1 (patch)
tree75b867826324b5180280376ae5450fa66357fad8 /themes
parentb47be29a9fae6e3ac2040b0d308831bbe746c14e (diff)
alert when deleting posts
Diffstat (limited to 'themes')
-rw-r--r--themes/okadmin/public/css/main.css5
-rw-r--r--themes/okadmin/public/js/app.js9
-rw-r--r--themes/okadmin/templates/resource.liquid2
3 files changed, 15 insertions, 1 deletions
diff --git a/themes/okadmin/public/css/main.css b/themes/okadmin/public/css/main.css
index d2a4418..ad940e8 100644
--- a/themes/okadmin/public/css/main.css
+++ b/themes/okadmin/public/css/main.css
@@ -248,10 +248,15 @@ label {
li.image-element:hover .remove-image {
display: block;
}
+li.image-element .remove-image:hover {
+ color: red;
+}
.remove-image {
display: none;
}
+#delete_form button:hover { color: red }
+
.template {
display: none;
}
diff --git a/themes/okadmin/public/js/app.js b/themes/okadmin/public/js/app.js
index 8c85663..441172f 100644
--- a/themes/okadmin/public/js/app.js
+++ b/themes/okadmin/public/js/app.js
@@ -59,6 +59,15 @@ var OKAdmin = function(){
})
})
+ $("#delete_form").submit(function(e){
+ if (confirm("Are you sure you want to delete this record?")) {
+ return
+ }
+ else {
+ e.preventDefault()
+ }
+ })
+
function pressEnter(fn){
return function(e){
if (e.keyCode && e.keyCode !== 13) return
diff --git a/themes/okadmin/templates/resource.liquid b/themes/okadmin/templates/resource.liquid
index 48e3ef2..c321e8a 100644
--- a/themes/okadmin/templates/resource.liquid
+++ b/themes/okadmin/templates/resource.liquid
@@ -14,7 +14,7 @@
<label>&nbsp;</label><button type="submit">Save</button>
<div class="clear"></div>
</form>
- <form action="." method="POST">
+ <form action="." method="POST" id="delete_form">
<input type="hidden" name="_method" value="DELETE">
<button type="submit">Delete</button>
</form>