зеркало из https://github.com/mozilla/pjs.git
handling disabled case for checkboxes and radios.
This commit is contained in:
Родитель
d1539159d3
Коммит
24ed16214d
|
@ -148,6 +148,11 @@ nsXULCheckboxElement::GetChecked(PRBool* aChecked)
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsXULCheckboxElement::SetChecked(PRBool aChecked)
|
nsXULCheckboxElement::SetChecked(PRBool aChecked)
|
||||||
{
|
{
|
||||||
|
PRBool disabled;
|
||||||
|
GetDisabled(&disabled);
|
||||||
|
if (disabled)
|
||||||
|
return NS_OK;
|
||||||
|
|
||||||
if(aChecked)
|
if(aChecked)
|
||||||
mOuter->SetAttribute("checked", "true");
|
mOuter->SetAttribute("checked", "true");
|
||||||
else
|
else
|
||||||
|
|
|
@ -83,6 +83,11 @@ nsXULRadioGroupElement::GetSelectedItem(nsIDOMXULRadioElement** aResult)
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsXULRadioGroupElement::SetSelectedItem(nsIDOMXULRadioElement* aItem)
|
nsXULRadioGroupElement::SetSelectedItem(nsIDOMXULRadioElement* aItem)
|
||||||
{
|
{
|
||||||
|
PRBool disabled;
|
||||||
|
aItem->GetDisabled(&disabled);
|
||||||
|
if (disabled)
|
||||||
|
return NS_OK;
|
||||||
|
|
||||||
if (mSelectedItem)
|
if (mSelectedItem)
|
||||||
mSelectedItem->SetChecked(PR_FALSE);
|
mSelectedItem->SetChecked(PR_FALSE);
|
||||||
mSelectedItem = aItem;
|
mSelectedItem = aItem;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче