mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-02 23:21:18 +08:00
Don't allow dropping of Launcher icons after trash in taskbar.
This commit is contained in:
parent
4da9f525da
commit
539b31cc5b
@ -43,6 +43,9 @@ async function UITaskbar(options){
|
|||||||
|
|
||||||
let h = '';
|
let h = '';
|
||||||
h += `<div id="ui-taskbar_${window.global_element_id}" class="taskbar" style="height:${window.taskbar_height}px;">`;
|
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);
|
$('.desktop').append(h);
|
||||||
|
|
||||||
@ -147,7 +150,7 @@ async function UITaskbar(options){
|
|||||||
$(popover).find('.start-app').draggable({
|
$(popover).find('.start-app').draggable({
|
||||||
appendTo: "body",
|
appendTo: "body",
|
||||||
revert: "invalid",
|
revert: "invalid",
|
||||||
connectToSortable: ".taskbar",
|
connectToSortable: ".taskbar-sortable",
|
||||||
zIndex: parseInt($(popover).css('z-index')) + 1,
|
zIndex: parseInt($(popover).css('z-index')) + 1,
|
||||||
scroll: false,
|
scroll: false,
|
||||||
distance: 5,
|
distance: 5,
|
||||||
@ -245,7 +248,7 @@ window.make_taskbar_sortable = function(){
|
|||||||
//-------------------------------------------
|
//-------------------------------------------
|
||||||
// Taskbar is sortable
|
// Taskbar is sortable
|
||||||
//-------------------------------------------
|
//-------------------------------------------
|
||||||
$('.taskbar').sortable({
|
$('.taskbar-sortable').sortable({
|
||||||
axis: "x",
|
axis: "x",
|
||||||
items: '.taskbar-item-sortable:not(.has-open-contextmenu)',
|
items: '.taskbar-item-sortable:not(.has-open-contextmenu)',
|
||||||
cancel: '.has-open-contextmenu',
|
cancel: '.has-open-contextmenu',
|
||||||
|
@ -61,9 +61,17 @@ function UITaskbarItem(options){
|
|||||||
|
|
||||||
if(options.append_to_taskbar) {
|
if(options.append_to_taskbar) {
|
||||||
if (options.before_trash){
|
if (options.before_trash){
|
||||||
$('.taskbar-item[data-app="trash"]').before(h);
|
$('.taskbar-sortable').append(h);
|
||||||
}else{
|
}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{
|
}else{
|
||||||
$('body').prepend(h);
|
$('body').prepend(h);
|
||||||
|
Loading…
Reference in New Issue
Block a user