app/assets/javascripts/admin/pages.js.coffee in tkh_admin_panel-0.9.2 vs app/assets/javascripts/admin/pages.js.coffee in tkh_admin_panel-0.9.3
- old
+ new
@@ -1,7 +1,23 @@
jQuery ->
+ # Some fields should be shown only for blog posts, others only for static content pages
+ if $('input#page_for_blog:checked').length>0
+ $('#page-short-title').hide()
+ $('#parent-page-title').hide()
+ else
+ $('#page-tag-list').hide()
+
+ # Toggle fields to be shown when user changes page to/from static content to/from blog post
+ $("input#page_for_blog").change ->
+ if $('input#page_for_blog:checked').length>0
+ $('#page-short-title').hide(450)
+ $('#parent-page-title').hide(450)
+ $('#page-tag-list').show(450)
+ else
+ $('#page-tag-list').hide(450)
+ $('#page-short-title').show(450)
+ $('#parent-page-title').show(450)
+
# Typeahead form field for autocomplete associations
$('#page_author_name').typeahead(
name: 'page_author_name',
local: $('#page_author_name').data('source') )
-
-