mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 16:35:47 +01:00
added help block to category purge button, updated iconSelect library to use templates in a better way, hooked up iconSelect for category mgmt, #2463
This commit is contained in:
@@ -308,6 +308,7 @@
|
||||
}
|
||||
|
||||
.category-preview {
|
||||
.pointer;
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
text-align: center;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
define('admin/manage/category', [
|
||||
'uploader',
|
||||
'admin/modules/iconSelect',
|
||||
'iconSelect',
|
||||
'admin/modules/colorpicker',
|
||||
'autocomplete'
|
||||
], function(uploader, iconSelect, colorpicker, autocomplete) {
|
||||
|
||||
@@ -19,8 +19,14 @@ define('iconSelect', function() {
|
||||
$('#icons .fa-icons .fa.' + selected).addClass('selected');
|
||||
}
|
||||
|
||||
bootbox.confirm('<h2>Select an icon.</h2>' + $('#icons').html(), function(confirm) {
|
||||
if (confirm) {
|
||||
templates.parse('partials/fontawesome', {}, function(html) {
|
||||
var picker = bootbox.dialog({
|
||||
message: html,
|
||||
title: 'Select an Icon',
|
||||
buttons: {
|
||||
success: {
|
||||
label: 'Save',
|
||||
callback: function(confirm) {
|
||||
var iconClass = $('.bootbox .selected').attr('class');
|
||||
var categoryIconClass = $('<div/>').addClass(iconClass).removeClass('fa').removeClass('selected').attr('class');
|
||||
if (categoryIconClass === 'fa-doesnt-exist') {
|
||||
@@ -31,17 +37,20 @@ define('iconSelect', function() {
|
||||
el.val(categoryIconClass);
|
||||
el.attr('value', categoryIconClass);
|
||||
|
||||
console.log(el);
|
||||
onModified(el);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
$('.bootbox .fa-icons i').on('click', function() {
|
||||
$('.bootbox .selected').removeClass('selected');
|
||||
picker.on('shown.bs.modal', function() {
|
||||
var modalEl = $(this);
|
||||
modalEl.find('.icon-container').on('click', 'i', function() {
|
||||
modalEl.find('.icon-container i').removeClass('selected');
|
||||
$(this).addClass('selected');
|
||||
});
|
||||
}, 500);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
return iconSelect;
|
||||
|
||||
@@ -133,6 +133,10 @@
|
||||
</div>
|
||||
<hr />
|
||||
<button class="btn btn-danger btn-block btn-xs purge"><i class="fa fa-eraser"></i> Purge Category</button>
|
||||
<p class="help-block">
|
||||
Purging a category will remove all topics and posts, and delete the category from the database. If you want to
|
||||
remove a category <em>temporarily</em>, you'll want to "disable" the category instead.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user