summaryrefslogtreecommitdiff
path: root/themes/okadmin/public/js/app.js
diff options
context:
space:
mode:
authorjulie lala <jules@okfoc.us>2015-04-13 16:45:41 -0400
committerjulie lala <jules@okfoc.us>2015-04-13 16:45:41 -0400
commitc702d76549ead663daed0147f5c160c368a61c45 (patch)
treecad22d834c0acd4c871a8bdaa148d1f1f19caf34 /themes/okadmin/public/js/app.js
parentedcc3c497f05e14bdd5655a0bc154cee04784a60 (diff)
parentebb17679c64723dc1378079f9da0697673b21f5d (diff)
Merge branch 'twohustlers' of github.com:okfocus/okcms into twohustlers
Diffstat (limited to 'themes/okadmin/public/js/app.js')
-rw-r--r--themes/okadmin/public/js/app.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/themes/okadmin/public/js/app.js b/themes/okadmin/public/js/app.js
index 1ab9956..91a8e1a 100644
--- a/themes/okadmin/public/js/app.js
+++ b/themes/okadmin/public/js/app.js
@@ -28,7 +28,7 @@ var OKAdmin = function(){
$(".captioned-image-list ol").disableSelection()
// delete image
- $(document).on("click", ".remove-image", function(){
+ $(document).on("mousedown", ".remove-image", function(){
if (confirm("Delete this image?")) {
$(this).parent().remove()
}
@@ -50,7 +50,14 @@ var OKAdmin = function(){
}))
// fix post indexing in list-driven inputs
- $(".main.resource form").submit(function(){
+ $(".main.resource form").submit(function(e){
+ var $id = $("[name=id]")
+ if ($id.length && ! $id.val()) {
+ alert("Please enter an ID")
+ $id.focus()
+ e.preventDefault()
+ return
+ }
$(".image-element").each(function(index){
$(this).find("input,textarea").each(function(){
var field = $(this).attr("name").replace(/\[[0-9]*\]/, "[" + index + "]")