@@ -338,39 +338,28 @@ local function export2collection(storage, image_table, extra_data)
338
338
339
339
-- install the module in the UI -----------------------------------------------
340
340
local function install_module (dr )
341
+
342
+ local views = {[dt .gui .views .lighttable ] = {" DT_UI_CONTAINER_PANEL_RIGHT_CENTER" , 100 }}
343
+ if dr then
344
+ views = {[dt .gui .views .lighttable ] = {" DT_UI_CONTAINER_PANEL_RIGHT_CENTER" , 100 },
345
+ [dt .gui .views .darkroom ] = {" DT_UI_CONTAINER_PANEL_LEFT_CENTER" , 100 }}
346
+ end
347
+
341
348
if not ee .module_installed then
342
- if dr then
343
- -- register new module "external editors" in lighttable and darkroom ----
344
- dt .register_lib (
345
- MODULE_NAME ,
346
- _ (" external editors" ),
347
- true , -- expandable
348
- false , -- resetable
349
- {[dt .gui .views .lighttable ] = {" DT_UI_CONTAINER_PANEL_RIGHT_CENTER" , 100 },
350
- [dt .gui .views .darkroom ] = {" DT_UI_CONTAINER_PANEL_LEFT_CENTER" , 100 }},
351
- dt .new_widget (" box" ) {
352
- orientation = " vertical" ,
353
- table.unpack (ee .widgets ),
354
- },
355
- nil , -- view_enter
356
- nil -- view_leave
357
- )
358
- else
359
- -- register new module "external editors" in lighttable only ------------
360
- dt .register_lib (
361
- MODULE_NAME ,
362
- _ (" external editors" ),
363
- true , -- expandable
364
- false , -- resetable
365
- {[dt .gui .views .lighttable ] = {" DT_UI_CONTAINER_PANEL_RIGHT_CENTER" , 100 }},
366
- dt .new_widget (" box" ) {
367
- orientation = " vertical" ,
368
- table.unpack (ee .widgets ),
369
- },
370
- nil , -- view_enter
371
- nil -- view_leave
372
- )
373
- end
349
+ -- register new module "external editors" in lighttable and darkroom ----
350
+ dt .register_lib (
351
+ MODULE_NAME ,
352
+ _ (" external editors" ),
353
+ true , -- expandable
354
+ false , -- resetable
355
+ views ,
356
+ dt .new_widget (" box" ) {
357
+ orientation = " vertical" ,
358
+ table.unpack (ee .widgets ),
359
+ },
360
+ nil , -- view_enter
361
+ nil -- view_leave
362
+ )
374
363
ee .module_installed = true
375
364
end
376
365
end
0 commit comments