Bug 432427: update 'download history' checkbox state to correctly reflect dependency on 'browsing history' checkbox, r=dietrich, a=beltzner

This commit is contained in:
gavin%gavinsharp.com 2008-05-06 18:52:09 +00:00
Родитель dd3da5681c
Коммит beb2fe34a3
1 изменённых файлов: 21 добавлений и 2 удалений

Просмотреть файл

@ -114,15 +114,34 @@
return undefined;
},
onReadDownloads: function (aEvent)
{
// Call the common function that will update the accept button if needed
this.onReadGeneric();
let historyPref = document.getElementById("privacy.item.history")
let downloadPref = document.getElementById("privacy.item.downloads");
// Disable the checkbox if history is selected
let downloads = document.getElementById("downloads-checkbox");
downloads.disabled = historyPref.value;
// The "Download History" checkbox is selected if either of the history or
// downloads preferences are true.
return historyPref.value || downloadPref.value;
},
updateDownloadHistory: function ()
{
// When toggling history, we automatically clear download history too,
// so we disable that control.
// so we disable that control and set its value to true.
let downloads = document.getElementById("downloads-checkbox");
let history = document.getElementById("history-checkbox");
let s = new Sanitizer();
downloads.disabled = history.checked ||
!s.canClearItem("downloads");
if (history.checked)
downloads.checked = true;
},
};
]]>
@ -152,7 +171,7 @@
label="&itemDownloads.label;"
accesskey="&itemDownloads.accesskey;"
preference="privacy.item.downloads"
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
onsyncfrompreference="return gSanitizePromptDialog.onReadDownloads();"/>
<checkbox label="&itemFormSearchHistory.label;"
accesskey="&itemFormSearchHistory.accesskey;"
preference="privacy.item.formdata"