|
@@ -18,6 +18,7 @@
|
|
|
*/
|
|
|
|
|
|
import UIContextMenu from './UIContextMenu.js';
|
|
|
+import path from '../lib/path.js';
|
|
|
|
|
|
let tray_item_id = 1;
|
|
|
|
|
@@ -28,7 +29,7 @@ function UITaskbarItem(options){
|
|
|
options.open_windows_count = options.open_windows_count ?? 0;
|
|
|
options.lock_keep_in_taskbar = options.lock_keep_in_taskbar ?? false;
|
|
|
options.append_to_taskbar = options.append_to_taskbar ?? true;
|
|
|
- const element_id = global_element_id++;
|
|
|
+ const element_id = window.global_element_id++;
|
|
|
|
|
|
h += `<div class = "taskbar-item ${options.sortable ? 'taskbar-item-sortable' : ''} disable-user-select"
|
|
|
id = "taskbar-item-${tray_item_id}"
|
|
@@ -121,7 +122,7 @@ function UITaskbarItem(options){
|
|
|
html: 'New Window',
|
|
|
val: $(this).attr('data-id'),
|
|
|
onClick: function(){
|
|
|
- launch_app({
|
|
|
+ window.launch_app({
|
|
|
name: options.app,
|
|
|
maximized: (isMobile.phone || isMobile.tablet),
|
|
|
})
|
|
@@ -140,7 +141,7 @@ function UITaskbarItem(options){
|
|
|
html: i18n('empty_trash'),
|
|
|
val: $(this).attr('data-id'),
|
|
|
onClick: async function(){
|
|
|
- empty_trash();
|
|
|
+ window.empty_trash();
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -155,9 +156,9 @@ function UITaskbarItem(options){
|
|
|
onClick: function(){
|
|
|
$(el_taskbar_item).attr('data-keep-in-taskbar', 'false');
|
|
|
if($(el_taskbar_item).attr('data-open-windows') === '0'){
|
|
|
- remove_taskbar_item(el_taskbar_item);
|
|
|
+ window.remove_taskbar_item(el_taskbar_item);
|
|
|
}
|
|
|
- update_taskbar();
|
|
|
+ window.update_taskbar();
|
|
|
options.keep_in_taskbar = false;
|
|
|
}
|
|
|
})
|
|
@@ -171,7 +172,7 @@ function UITaskbarItem(options){
|
|
|
val: $(this).attr('data-id'),
|
|
|
onClick: function(){
|
|
|
$(el_taskbar_item).attr('data-keep-in-taskbar', 'true');
|
|
|
- update_taskbar();
|
|
|
+ window.update_taskbar();
|
|
|
options.keep_in_taskbar = true;
|
|
|
}
|
|
|
})
|
|
@@ -247,7 +248,7 @@ function UITaskbarItem(options){
|
|
|
tolerance: 'pointer',
|
|
|
drop: async function( event, ui ) {
|
|
|
// Check if hovering over an item that is VISIBILE
|
|
|
- if($(event.target).closest('.window').attr('data-id') !== $(mouseover_window).attr('data-id'))
|
|
|
+ if($(event.target).closest('.window').attr('data-id') !== $(window.mouseover_window).attr('data-id'))
|
|
|
return;
|
|
|
|
|
|
// If ctrl is pressed and source is Trashed, cancel whole operation
|
|
@@ -294,7 +295,7 @@ function UITaskbarItem(options){
|
|
|
// open each item
|
|
|
for (let i = 0; i < items_to_sign.length; i++) {
|
|
|
const item = items_to_sign[i];
|
|
|
- launch_app({
|
|
|
+ window.launch_app({
|
|
|
name: options.app,
|
|
|
file_path: item.path,
|
|
|
// app_obj: open_item_meta.suggested_apps[0],
|
|
@@ -325,7 +326,7 @@ function UITaskbarItem(options){
|
|
|
over: function(event, ui){
|
|
|
// Check hovering over an item that is VISIBILE
|
|
|
const $event_parent_win = $(event.target).closest('.window')
|
|
|
- if( $event_parent_win.length > 0 && $event_parent_win.attr('data-id') !== $(mouseover_window).attr('data-id'))
|
|
|
+ if( $event_parent_win.length > 0 && $event_parent_win.attr('data-id') !== $(window.mouseover_window).attr('data-id'))
|
|
|
return;
|
|
|
// Don't do anything if the dragged item is NOT a UIItem
|
|
|
if(!$(ui.draggable).hasClass('item'))
|