rename `dismiss_on_submit|2` to `dismiss_on_select|2`

to avoid confusion
develop
Timur Kelman 2021-07-30 17:25:01 +02:00 committed by GitHub
parent ffecdf3b53
commit 15d8a0bea2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

@ -150,8 +150,8 @@ ListBox.focus_path = 'ListBox'
ListBox.ATTRS{ ListBox.ATTRS{
with_filter = false, with_filter = false,
dismiss_on_submit = true, dismiss_on_select = true,
dismiss_on_submit2 = true, dismiss_on_select2 = true,
cursor_pen = DEFAULT_NIL, cursor_pen = DEFAULT_NIL,
select_pen = DEFAULT_NIL, select_pen = DEFAULT_NIL,
on_select = DEFAULT_NIL, on_select = DEFAULT_NIL,
@ -176,7 +176,7 @@ function ListBox:init(info)
local on_submit2 local on_submit2
if self.select2_hint or self.on_select2 then if self.select2_hint or self.on_select2 then
on_submit2 = function(sel, obj) on_submit2 = function(sel, obj)
if self.dismiss_on_submit2 then self:dismiss() end if self.dismiss_on_select2 then self:dismiss() end
if self.on_select2 then self.on_select2(sel, obj) end if self.on_select2 then self.on_select2(sel, obj) end
local cb = obj.on_select2 local cb = obj.on_select2
if cb then cb(obj, sel) end if cb then cb(obj, sel) end
@ -192,7 +192,7 @@ function ListBox:init(info)
text_pen = spen, text_pen = spen,
cursor_pen = cpen, cursor_pen = cpen,
on_submit = function(sel,obj) on_submit = function(sel,obj)
if self.dismiss_on_submit then self:dismiss() end if self.dismiss_on_select then self:dismiss() end
if self.on_select then self.on_select(sel, obj) end if self.on_select then self.on_select(sel, obj) end
local cb = obj.on_select or obj[2] local cb = obj.on_select or obj[2]
if cb then cb(obj, sel) end if cb then cb(obj, sel) end