diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-04-13 12:34:50 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-04-13 12:34:50 -0400 |
| commit | 90b27c7e5aac1b81aac471d07f8f42dccb90d90b (patch) | |
| tree | 6862d0aff31308302a52de06e0beeac2afa8c471 /themes/okadmin/public/js | |
| parent | 3b16b2d58f876f6ab4abcdf8012efb2411504940 (diff) | |
styling/debugging
Diffstat (limited to 'themes/okadmin/public/js')
| -rw-r--r-- | themes/okadmin/public/js/app.js | 11 |
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 + "]") |
