mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-14 17:56:16 +01:00
inline editing of admin/categories description & name
This commit is contained in:
@@ -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() {
|
$(function() {
|
||||||
var url = window.location.href,
|
var url = window.location.href,
|
||||||
parts = url.split('/'),
|
parts = url.split('/'),
|
||||||
@@ -241,6 +256,8 @@ define(['uploader'], function(uploader) {
|
|||||||
|
|
||||||
$(this).addClass('hide').hide();
|
$(this).addClass('hide').hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setupEditTargets();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user