зеркало из https://github.com/mozilla/pjs.git
fixes for bug 41015. accidentally broke checkmenus trying to fix radio menus. also fixing it so that radio menus no long uncheck their siblings twice. r=saari.
This commit is contained in:
Родитель
4031dc0bb4
Коммит
ba231e24c5
|
@ -115,6 +115,14 @@ nsMenuItem::GetEnabled(PRBool *aIsEnabled)
|
|||
NS_METHOD nsMenuItem::SetChecked(PRBool aIsEnabled)
|
||||
{
|
||||
mIsChecked = aIsEnabled;
|
||||
|
||||
// update the content model
|
||||
if ( mIsChecked )
|
||||
mDOMElement->SetAttribute(NS_ConvertASCIItoUCS2("checked"), NS_ConvertASCIItoUCS2("true"));
|
||||
else
|
||||
mDOMElement->SetAttribute(NS_ConvertASCIItoUCS2("checked"), NS_ConvertASCIItoUCS2("false"));
|
||||
|
||||
// uncheck others if we're a radiomenu
|
||||
if ( mMenuType == eRadio && aIsEnabled )
|
||||
UncheckRadioSiblings ( mDOMElement );
|
||||
|
||||
|
@ -189,7 +197,6 @@ nsEventStatus nsMenuItem::MenuItemSelected(const nsMenuEvent & aMenuEvent)
|
|||
if ( mIsChecked )
|
||||
break;
|
||||
SetChecked(PR_TRUE);
|
||||
UncheckRadioSiblings(mDOMElement);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче