aboutsummaryrefslogtreecommitdiff
path: root/data/assets/js/admin/dialogs/post-edit.js
diff options
context:
space:
mode:
Diffstat (limited to 'data/assets/js/admin/dialogs/post-edit.js')
-rw-r--r--data/assets/js/admin/dialogs/post-edit.js11
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(),