mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: dedicated sorting buttons for plugin ordering in ACP
This commit is contained in:
@@ -22,6 +22,23 @@
|
|||||||
.plugin-list.ui-sortable {
|
.plugin-list.ui-sortable {
|
||||||
li {
|
li {
|
||||||
.pointer;
|
.pointer;
|
||||||
|
|
||||||
|
.fa-chevron-up {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fa-chevron-up, .fa-chevron-down {
|
||||||
|
border: 1px solid;
|
||||||
|
border-radius: 50%;
|
||||||
|
padding: 3px;
|
||||||
|
vertical-align: 1px;
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:first-child .fa-chevron-up, &:last-child .fa-chevron-down {
|
||||||
|
pointer-events: none;
|
||||||
|
color: @gray-light;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.controls .btn {
|
.controls .btn {
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ define('admin/extend/plugins', ['jqueryui', 'translator', 'benchpress'], functio
|
|||||||
}
|
}
|
||||||
var html = '';
|
var html = '';
|
||||||
activePlugins.forEach(function (plugin) {
|
activePlugins.forEach(function (plugin) {
|
||||||
html += '<li class="">' + plugin + '</li>';
|
html += '<li class="">' + plugin + '<span class="pull-right"><i class="fa fa-chevron-up"></i><i class="fa fa-chevron-down"></i></span></li>';
|
||||||
});
|
});
|
||||||
if (!activePlugins.length) {
|
if (!activePlugins.length) {
|
||||||
translator.translate('[[admin/extend/plugins:none-active]]', function (text) {
|
translator.translate('[[admin/extend/plugins:none-active]]', function (text) {
|
||||||
@@ -176,7 +176,18 @@ define('admin/extend/plugins', ['jqueryui', 'translator', 'benchpress'], functio
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$('#order-active-plugins-modal .plugin-list').html(html).sortable();
|
var list = $('#order-active-plugins-modal .plugin-list');
|
||||||
|
list.html(html).sortable();
|
||||||
|
|
||||||
|
list.find('.fa-chevron-up').on('click', function () {
|
||||||
|
var item = $(this).parents('li');
|
||||||
|
item.prev().before(item);
|
||||||
|
});
|
||||||
|
|
||||||
|
list.find('.fa-chevron-down').on('click', function () {
|
||||||
|
var item = $(this).parents('li');
|
||||||
|
item.next().after(item);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user