Bläddra i källkod

cast `selectable_body` and `multiselectable` to Boolean

Nariman Jelveh 11 månader sedan
förälder
incheckning
41e307bd5b
3 ändrade filer med 3 tillägg och 3 borttagningar
  1. 1 1
      src/UI/UIItem.js
  2. 1 1
      src/UI/UIWindow.js
  3. 1 1
      src/helpers.js

+ 1 - 1
src/UI/UIItem.js

@@ -55,7 +55,7 @@ function UIItem(options){
     options.is_shortcut = options.is_shortcut ?? 0;
     options.is_trash = options.is_trash ?? false;
     options.metadata = options.metadata ?? '';
-    options.multiselectable = options.multiselectable ?? true;
+    options.multiselectable = (options.multiselectable === undefined || options.multiselectable === true) ? true : false;
     options.shortcut_to = options.shortcut_to ?? '';
     options.shortcut_to_path = options.shortcut_to_path ?? '';
     options.immutable = (options.immutable === false || options.immutable === 0 || options.immutable === undefined ? 0 : 1);

+ 1 - 1
src/UI/UIWindow.js

@@ -99,7 +99,7 @@ async function UIWindow(options) {
     options.show_minimize_button = options.show_minimize_button ?? true;
     options.on_close = options.on_close ?? undefined;
     options.parent_uuid = options.parent_uuid ?? null;
-    options.selectable_body = options.selectable_body ?? true;
+    options.selectable_body = (options.selectable_body === undefined || options.selectable_body === true) ? true : false;
     options.show_in_taskbar = options.show_in_taskbar ?? true;
     options.show_maximize_button = options.show_maximize_button ?? true;
     options.single_instance = options.single_instance ?? false;

+ 1 - 1
src/helpers.js

@@ -2678,7 +2678,7 @@ window.get_html_element_from_options = async function(options){
     options.is_shortcut = options.is_shortcut ?? 0;
     options.is_trash = options.is_trash ?? false;
     options.metadata = options.metadata ?? '';
-    options.multiselectable = options.multiselectable ?? true;
+    options.multiselectable = (!options.multiselectable || options.multiselectable === true) ? true : false;
     options.shortcut_to = options.shortcut_to ?? '';
     options.shortcut_to_path = options.shortcut_to_path ?? '';
     options.immutable = (options.immutable === false || options.immutable === 0 || options.immutable === undefined ? 0 : 1);