mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-06 21:40:37 +01:00
dhtmlxmenu now doesn't autohide after clicking on checkboxes/radiobuttons, click handler can specifiy whether the field should be checked/unchecked
This commit is contained in:
parent
5e014cdfe2
commit
7ae2588e84
@ -222,9 +222,7 @@ egwAction.prototype.execute = function(_senders, _target)
|
||||
_target == null;
|
||||
}
|
||||
|
||||
this.onExecute.exec(this, _senders, _target);
|
||||
|
||||
return false;
|
||||
return this.onExecute.exec(this, _senders, _target);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -324,7 +324,7 @@ function egwPopupActionImplementation()
|
||||
item.set_onClick(function(elem) {
|
||||
// Copy the "checked" state
|
||||
elem.data.checked = elem.checked;
|
||||
elem.data.execute(_selected, _target);
|
||||
return elem.data.execute(_selected, _target);
|
||||
});
|
||||
}
|
||||
else
|
||||
|
@ -23,9 +23,40 @@ function egwMenuImpl(_structure)
|
||||
if (id)
|
||||
{
|
||||
var elem = self.dhtmlxmenu.getUserData(id, 'egw_menu');
|
||||
|
||||
if (elem && elem.onClick)
|
||||
{
|
||||
elem.onClick(elem);
|
||||
if (elem.checkbox)
|
||||
{
|
||||
self.dhtmlxmenu.setContextMenuHideAllMode(false);
|
||||
}
|
||||
|
||||
var res = elem.onClick(elem);
|
||||
|
||||
if (elem.checkbox)
|
||||
{
|
||||
var checked = null;
|
||||
if (res == "checkbox:disable")
|
||||
{
|
||||
checked = false;
|
||||
}
|
||||
if (res == "checkbox:enable")
|
||||
{
|
||||
checked = true;
|
||||
}
|
||||
|
||||
if (checked != null)
|
||||
{
|
||||
if (elem.groupIndex != 0)
|
||||
{
|
||||
self.dhtmlxmenu.setRadioChecked(id, checked);
|
||||
}
|
||||
else
|
||||
{
|
||||
self.dhtmlxmenu.setCheckboxState(id, checked);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -349,7 +349,9 @@
|
||||
"checkbox": true,
|
||||
"checked": false,
|
||||
"caption": "Test2",
|
||||
"onExecute": alertClicked
|
||||
"onExecute": function() {
|
||||
return "checkbox:disable";
|
||||
}
|
||||
}
|
||||
]
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user