|
|
@ -318,11 +318,16 @@ function core.on_event(type, ...) |
|
|
|
core.root_view:on_mouse_wheel(...) |
|
|
|
elseif type == "filedropped" then |
|
|
|
local filename, mx, my = ... |
|
|
|
local ok, doc = core.try(core.open_doc, filename) |
|
|
|
if ok then |
|
|
|
local node = core.root_view.root_node:get_child_overlapping_point(mx, my) |
|
|
|
node:set_active_view(node.active_view) |
|
|
|
core.root_view:open_doc(doc) |
|
|
|
local info = system.get_file_info(filename) |
|
|
|
if info and info.type == "dir" then |
|
|
|
system.exec(string.format("%q %q", EXEFILE, filename)) |
|
|
|
else |
|
|
|
local ok, doc = core.try(core.open_doc, filename) |
|
|
|
if ok then |
|
|
|
local node = core.root_view.root_node:get_child_overlapping_point(mx, my) |
|
|
|
node:set_active_view(node.active_view) |
|
|
|
core.root_view:open_doc(doc) |
|
|
|
end |
|
|
|
end |
|
|
|
elseif type == "quit" then |
|
|
|
core.quit() |
|
|
|