fix order plugins

isekai-main
Barış Soner Uşaklı 2 years ago
parent 3e8bcdc6b8
commit e0f25b3633

@ -1,30 +1,13 @@
.plugins {
.plugin-list.ui-sortable {
li {
cursor: 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-300;
}
&:last-child {
border-bottom: none!important;
}
}
.controls .btn {
display: list-item;
width: 150px;
margin-bottom: 3px;
margin-left: 10px;
}
}

@ -194,7 +194,19 @@ define('admin/extend/plugins', [
}
let html = '';
activePlugins.forEach(function (plugin) {
html += '<li class="">' + plugin + '<span class="float-end"><i class="fa fa-chevron-up"></i><i class="fa fa-chevron-down"></i></span></li>';
html += `
<li class="d-flex justify-content-between gap-1 pointer border-bottom pb-2">
${plugin}
<div class="d-flex gap-1">
<div class="btn-ghost-sm move-up">
<i class="fa fa-chevron-up"></i>
</div>
<div class="btn-ghost-sm move-down">
<i class="fa fa-chevron-down"></i>
</div>
</div>
</li>
`;
});
if (!activePlugins.length) {
translator.translate('[[admin/extend/plugins:none-active]]', function (text) {
@ -205,12 +217,12 @@ define('admin/extend/plugins', [
const list = $('#order-active-plugins-modal .plugin-list');
list.html(html).sortable();
list.find('.fa-chevron-up').on('click', function () {
list.find('.move-up').on('click', function () {
const item = $(this).parents('li');
item.prev().before(item);
});
list.find('.fa-chevron-down').on('click', function () {
list.find('.move-down').on('click', function () {
const item = $(this).parents('li');
item.next().after(item);
});

@ -123,7 +123,7 @@
<p>
[[admin/extend/plugins:order.explanation]]
</p>
<ul class="plugin-list"></ul>
<ul class="plugin-list list-unstyled d-flex flex-column gap-2"></ul>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">[[global:buttons.close]]</button>

Loading…
Cancel
Save