Added compatibility for lua events API change 6.2.1.
This commit is contained in:
@@ -114,6 +114,7 @@ img_time.module_installed = false
|
||||
img_time.event_registered = false
|
||||
|
||||
du.check_min_api_version("3.0.0", "image_time")
|
||||
local CURR_API_STRING = dt.configuration.api_version_string
|
||||
|
||||
|
||||
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
||||
@@ -551,7 +552,7 @@ if dt.gui.current_view().id == "lighttable" then
|
||||
else
|
||||
if not img_time.event_registered then
|
||||
dt.register_event(
|
||||
"view-changed",
|
||||
CURR_API_STRING >= "6.2.1" and "image_time", "view-changed" or "view-changed" ,
|
||||
function(event, old_view, new_view)
|
||||
if new_view.name == "lighttable" and old_view.name == "darkroom" then
|
||||
install_module()
|
||||
|
||||
Reference in New Issue
Block a user