mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 15:35:47 +01:00
@@ -1,4 +1,4 @@
|
||||
define(function() {
|
||||
define(['uploader'], function(uploader) {
|
||||
var Categories = {};
|
||||
|
||||
Categories.init = function() {
|
||||
@@ -147,7 +147,6 @@ define(function() {
|
||||
var btn = $(this);
|
||||
var categoryRow = btn.parents('li');
|
||||
var cid = categoryRow.attr('data-cid');
|
||||
console.log(this.getAttribute('data-disabled'));
|
||||
|
||||
var disabled = this.getAttribute('data-disabled') === '0' ? '1' : '0';
|
||||
categoryRow.remove();
|
||||
@@ -179,6 +178,17 @@ define(function() {
|
||||
var cid = $(this).parents('li[data-cid]').attr('data-cid');
|
||||
Categories.launchPermissionsModal(cid);
|
||||
});
|
||||
|
||||
|
||||
$('.upload-button').on('click', function() {
|
||||
var inputEl = this;
|
||||
|
||||
uploader.open(config.relative_path + '/admin/category/uploadpicture', function(imageUrlOnServer) {
|
||||
inputEl.value = imageUrlOnServer;
|
||||
$(inputEl).parents('li[data-cid]').find('.preview-box').css('background', 'url(' + imageUrlOnServer + '?' + new Date().getTime() + ')');
|
||||
modified(inputEl);
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user