v1.18.x
Barış Soner Uşaklı 4 years ago
commit 72e82c4aca

@ -22,6 +22,23 @@
.plugin-list.ui-sortable {
li {
.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 {

@ -168,7 +168,7 @@ define('admin/extend/plugins', ['jqueryui', 'translator', 'benchpress'], functio
}
var html = '';
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) {
translator.translate('[[admin/extend/plugins:none-active]]', function (text) {
@ -176,7 +176,18 @@ define('admin/extend/plugins', ['jqueryui', 'translator', 'benchpress'], functio
});
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);
});
});
});

Loading…
Cancel
Save