summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-04-09 02:09:20 -0400
committerJules Laplace <jules@okfoc.us>2015-04-09 02:09:20 -0400
commit8f68b854b800075d3e3d413345037adb5c4e534a (patch)
tree69b14df0f98a2888520e26d92a9aeaf89f5c0539
parent62fc7c328c78f5aff5a4f7ec95a5631c7d4e204b (diff)
delete image
-rw-r--r--themes/okadmin/public/css/main.css10
-rw-r--r--themes/okadmin/public/js/app.js8
-rw-r--r--themes/okadmin/templates/partials/inputs.liquid3
3 files changed, 18 insertions, 3 deletions
diff --git a/themes/okadmin/public/css/main.css b/themes/okadmin/public/css/main.css
index 0ba6286..d67d312 100644
--- a/themes/okadmin/public/css/main.css
+++ b/themes/okadmin/public/css/main.css
@@ -202,6 +202,16 @@ label {
margin-top: 1.0em;
}
+.main.resource form img {
+ width: 10em;
+ max-height: 10em;
+ border: 0;
+}
+.main.resource form textarea.caption {
+ width: 15em;
+ height: 9em;
+}
+
.template {
display: none;
}
diff --git a/themes/okadmin/public/js/app.js b/themes/okadmin/public/js/app.js
index 84c0f53..7a5eb60 100644
--- a/themes/okadmin/public/js/app.js
+++ b/themes/okadmin/public/js/app.js
@@ -22,7 +22,13 @@ var OKAdmin = function(){
$el.parent().find(".video-thumb").val( media.thumbnail )
})
})
-
+
+ $(document).on("click", ".remove-image", function(){
+ if (confirm("Delete this image?")) {
+ $(this).parent().remove()
+ }
+ })
+
$("form").submit(function(){
$(".template").remove()
})
diff --git a/themes/okadmin/templates/partials/inputs.liquid b/themes/okadmin/templates/partials/inputs.liquid
index 3a33f95..25aef30 100644
--- a/themes/okadmin/templates/partials/inputs.liquid
+++ b/themes/okadmin/templates/partials/inputs.liquid
@@ -44,8 +44,7 @@
<li class="image-element">
<img src="{{image.uri}}" alt="{{image.caption}}">
<input type="hidden" name="{{name}}[][uri]" value="{{image.uri}}">
- <div class="clear"></div>
- <input type="text" name="{{name}}[][caption]" value="{{image.caption}}">
+ <textarea class="caption" name="{{name}}[][caption]">{{image.caption}}</textarea>
<button class="remove-image">-</button>
</li>
{% endfor %}