Bug 1129930 - JavaScript error: chrome://browser/content/preferences/in-content/preferences.js, line 82: TypeError: getComputedStyle(...) is null. r=Gijs

This commit is contained in:
Ian Moody 2015-02-05 16:48:46 +00:00
parent bf52249de4
commit 4f06461dbd

View File

@ -69,6 +69,8 @@ function init_all() {
window.addEventListener("hashchange", onHashChange);
gotoPref();
init_dynamic_padding();
var initFinished = new CustomEvent("Initialized", {
'bubbles': true,
'cancelable': true
@ -78,7 +80,18 @@ function init_all() {
let helpCmd = document.getElementById("help-button");
helpCmd.addEventListener("command", helpButtonCommand);
// Make the space above the categories list shrink on low window heights
// Wait until initialization of all preferences are complete before
// notifying observers that the UI is now ready.
Services.obs.notifyObservers(window, "advanced-pane-loaded", null);
}
window.addEventListener("unload", function onUnload() {
gSubDialog.uninit();
});
// Make the space above the categories list shrink on low window heights
function init_dynamic_padding() {
let categories = document.getElementById("categories");
let catPadding = Number.parseInt(getComputedStyle(categories)
.getPropertyValue('padding-top'));
let fullHeight = categories.lastElementChild.getBoundingClientRect().bottom;
@ -93,16 +106,8 @@ function init_all() {
mediaStyle.setAttribute('type', 'text/css');
mediaStyle.appendChild(document.createCDATASection(mediaRule));
document.documentElement.appendChild(mediaStyle);
// Wait until initialization of all preferences are complete before
// notifying observers that the UI is now ready.
Services.obs.notifyObservers(window, "advanced-pane-loaded", null);
}
window.addEventListener("unload", function onUnload() {
gSubDialog.uninit();
});
function onHashChange() {
gotoPref();
}