summaryrefslogtreecommitdiff
path: root/themes/okadmin/public/js/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'themes/okadmin/public/js/app.js')
-rw-r--r--themes/okadmin/public/js/app.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/themes/okadmin/public/js/app.js b/themes/okadmin/public/js/app.js
index b53d21f..ab571f3 100644
--- a/themes/okadmin/public/js/app.js
+++ b/themes/okadmin/public/js/app.js
@@ -51,7 +51,8 @@ var OKAdmin = function(){
// fix post indexing in list-driven inputs
$(".main.resource form").submit(function(e){
- var $id = $("[name=id]"), $title = $("[name=title]"), $shortname = $("[name=shortname]")
+ var $id = $("[name=id]"), $title = $("[name=title]"), $shortname = $("[name=shortname]"), $section = $(".resource.main")
+ var id = $section.data("id"), type = $section.data("type")
if ($title.length && ! $title.val()) {
alert("Please enter a title")
@@ -65,8 +66,14 @@ var OKAdmin = function(){
return
}
- var slug = slugify( $title.val() )
- $id.val( slug )
+ // TODO: pass through whether this page is static
+ if (type === "page" && (id == "contact" || id == "about")) {
+ ;
+ }
+ else {
+ var slug = slugify( $title.val() )
+ $id.val( slug )
+ }
$(".image-element").each(function(index){
$(this).find("input,textarea").each(function(){