File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -411,10 +411,28 @@ local box1 = dt.new_widget("box") {
411
411
}
412
412
413
413
414
- -- install module in lighttable and darkroom ----------------------------------
414
+ -- table with all the widgets ---------------- ----------------------------------
415
415
table.insert (ee .widgets , combobox )
416
416
table.insert (ee .widgets , box1 )
417
- install_module ()
417
+
418
+
419
+ -- register new module, but only when in lighttable ----------------------------
420
+ if dt .gui .current_view ().id == " lighttable" then
421
+ install_module ()
422
+ else
423
+ if not ee .event_registered then
424
+ dt .register_event (
425
+ MODULE_NAME , " view-changed" ,
426
+ function (event , old_view , new_view )
427
+ if new_view .name == " lighttable" and old_view .name == " darkroom" then
428
+ install_module ()
429
+ end
430
+ end
431
+ )
432
+ ee .event_registered = true
433
+ end
434
+ end
435
+
418
436
419
437
-- initialize list of programs and widgets ------------------------------------
420
438
UpdateProgramList (combobox , button_edit , button_edit_copy , false )
You can’t perform that action at this time.
0 commit comments