mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 07:25:46 +01:00
putting category options behind a dropdown, and fixing category enable/disable
This commit is contained in:
@@ -134,21 +134,22 @@ define(function() {
|
||||
modified(ev.target);
|
||||
});
|
||||
|
||||
$('.entry-row button[data-disabled]').each(function(index, element) {
|
||||
$('.dropdown li[data-disabled]').each(function(index, element) {
|
||||
var disabled = $(element).attr('data-disabled');
|
||||
if (disabled == "0" || disabled == "") {
|
||||
$(element).html('Disable');
|
||||
$(element).html('<a href="#"><i class="fa fa-power-off"></i> Disable</a>');
|
||||
} else {
|
||||
$(element).html('Enable');
|
||||
$(element).html('<a href="#"><i class="fa fa-power-off"></i> Enable</a>');
|
||||
}
|
||||
});
|
||||
|
||||
$('#entry-container').on('click', '.disable-btn', function(ev) {
|
||||
$('.dropdown').on('click', '[data-disabled]', function(ev) {
|
||||
var btn = $(this);
|
||||
var categoryRow = btn.parents('li');
|
||||
var cid = categoryRow.attr('data-cid');
|
||||
console.log(this.getAttribute('data-disabled'));
|
||||
|
||||
var disabled = btn.html() == "Disable" ? "1" : "0";
|
||||
var disabled = this.getAttribute('data-disabled') === '0' ? '1' : '0';
|
||||
categoryRow.remove();
|
||||
modified_categories[cid] = modified_categories[cid] || {};
|
||||
modified_categories[cid]['disabled'] = disabled;
|
||||
|
||||
Reference in New Issue
Block a user