Don't allow dropping of Launcher icons after trash in taskbar.

This commit is contained in:
jelveh 2024-12-30 22:02:42 -08:00
parent 4da9f525da
commit 539b31cc5b
2 changed files with 15 additions and 4 deletions

View File

@ -43,6 +43,9 @@ async function UITaskbar(options){
let h = '';
h += `<div id="ui-taskbar_${window.global_element_id}" class="taskbar" style="height:${window.taskbar_height}px;">`;
h += `<div class="taskbar-sortable" style="display: flex; justify-content: center; z-index: 99999;"></div>`;
h += `</div>`;
$('.desktop').append(h);
@ -147,7 +150,7 @@ async function UITaskbar(options){
$(popover).find('.start-app').draggable({
appendTo: "body",
revert: "invalid",
connectToSortable: ".taskbar",
connectToSortable: ".taskbar-sortable",
zIndex: parseInt($(popover).css('z-index')) + 1,
scroll: false,
distance: 5,
@ -245,7 +248,7 @@ window.make_taskbar_sortable = function(){
//-------------------------------------------
// Taskbar is sortable
//-------------------------------------------
$('.taskbar').sortable({
$('.taskbar-sortable').sortable({
axis: "x",
items: '.taskbar-item-sortable:not(.has-open-contextmenu)',
cancel: '.has-open-contextmenu',

View File

@ -61,9 +61,17 @@ function UITaskbarItem(options){
if(options.append_to_taskbar) {
if (options.before_trash){
$('.taskbar-item[data-app="trash"]').before(h);
$('.taskbar-sortable').append(h);
}else{
$('.taskbar').append(h);
if(options.sortable)
$('.taskbar-sortable').append(h);
else{
// if taskbar-sortable is empty then append before it
if($('.taskbar-sortable').children().length === 0)
$('.taskbar').find('.taskbar-sortable').before(h);
else
$('.taskbar').find('.taskbar-sortable').after(h);
}
}
}else{
$('body').prepend(h);