jsdialog: support toggle event for push buttons

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Ibd5a2d6de35c2f7142afe0254f4133746152226d
This commit is contained in:
Pranam Lashkari 2023-03-03 02:36:24 +05:30 committed by Szymon Kłos
parent 5457c51d76
commit 3694258e99

View file

@ -1520,7 +1520,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
else if (builder._responses[pushbutton.id] !== undefined)
pushbutton.onclick = builder.callback.bind(builder, 'responsebutton', 'click', { id: pushbutton.id }, builder._responses[pushbutton.id], builder);
else
pushbutton.onclick = builder.callback.bind(builder, 'pushbutton', 'click', pushbutton, data.command, builder);
pushbutton.onclick = builder.callback.bind(builder, 'pushbutton', data.isToggle ? 'toggle' : 'click', pushbutton, data.command, builder);
builder.map.hideRestrictedItems(data, wrapper, pushbutton);
builder.map.disableLockedItem(data, wrapper, pushbutton);