diff options
author | Paul Duncan <pabs@pablotron.org> | 2016-07-30 14:21:14 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2016-07-30 14:21:14 -0400 |
commit | e6ebc011f255596f09fec40f69049514d52bebef (patch) | |
tree | 20685173557726f1f470a7f40321281e1347d4eb /data/assets/js/admin/dialogs/post-edit.js | |
parent | b0083827f30fccc9aabcabed0557ace83d570b8c (diff) | |
download | guff-e6ebc011f255596f09fec40f69049514d52bebef.tar.bz2 guff-e6ebc011f255596f09fec40f69049514d52bebef.zip |
add tabs to site-add, refactor textarea handling, and fix site_id post edit dialogs
Diffstat (limited to 'data/assets/js/admin/dialogs/post-edit.js')
-rw-r--r-- | data/assets/js/admin/dialogs/post-edit.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/data/assets/js/admin/dialogs/post-edit.js b/data/assets/js/admin/dialogs/post-edit.js index 9d90b99..d7eb120 100644 --- a/data/assets/js/admin/dialogs/post-edit.js +++ b/data/assets/js/admin/dialogs/post-edit.js @@ -5,13 +5,8 @@ jQuery(function($) { }); function update_slug(name, slug) { - if (slug.prop('disabled')) { - slug.val( - name.val().toLowerCase() - .replace(/[^a-z0-9_-]+/g, '-') - .replace(/^-+|-+$/g, '') - ); - } + if (slug.prop('disabled')) + slug.val(slugify(name.val())); } $.each(['blog', 'page', 'project'], function(i, id) { @@ -22,6 +17,7 @@ jQuery(function($) { slug_lock = (r.slug_lock == "1"); $(p + 'name').val(r.name); + $(p + 'site').val(r.site_id); $(p + 'slug').val(r.slug) .prop('disabled', slug_lock ? 'disabled' : null); @@ -100,6 +96,7 @@ jQuery(function($) { send(id + "/set", $.extend({ post_id: $(p + 'dialog').data('post_id'), + site_id: $(p + 'site').val(), name: $(p + 'name').val(), slug_lock: $(p + 'slug-lock').hasClass('btn-default') ? 't' : 'f', slug: $(p + 'slug').val(), |