Skip to content

Node.js based forum software built for the modern web

inline editing of admin/categories description & name

psychobunnya5e304cc0adb
diff --git a/public/src/forum/admin/categories.js b/public/src/forum/admin/categories.js
index 8d94711944..dd7d682120 100644
--- a/public/src/forum/admin/categories.js
+++ b/public/src/forum/admin/categories.js
@@ -157,6 +157,21 @@ define(['uploader'], function(uploader) {
});
}
+ function setupEditTargets() {
+ $('[data-edit-target]').on('click', function() {
+ var $this = $(this),
+ target = $($this.attr('data-edit-target'));
+
+ $this.addClass('hide');
+ target.removeClass('hide').on('blur', function() {
+ $this.removeClass('hide').children('span').html(this.value);
+ $(this).addClass('hide');
+ }).val($this.children('span').html());
+
+ target.focus();
+ });
+ }
+
$(function() {
var url = window.location.href,
parts = url.split('/'),
@@ -241,6 +256,8 @@ define(['uploader'], function(uploader) {
$(this).addClass('hide').hide();
});
+
+ setupEditTargets();
});
};