Bug 1106415 - Allow the add-on SDK to dynamically insert add-on options. r=mfinkle

--HG--
extra : rebase_source : fb958f6d6f77cd6bc2d356b6b76107fc653dff12
extra : amend_source : 67b932a1a42836cc824478ffe11f4b8f4da592a7
This commit is contained in:
Margaret Leibovic 2014-12-08 11:24:13 -08:00
parent ba4481fc88
commit d12b17372c
2 changed files with 4 additions and 10 deletions

View File

@ -348,15 +348,11 @@ var Addons = {
let event = document.createEvent("Events"); let event = document.createEvent("Events");
event.initEvent("AddonOptionsLoad", true, false); event.initEvent("AddonOptionsLoad", true, false);
window.dispatchEvent(event); window.dispatchEvent(event);
// Also send a notification to match the behavior of desktop Firefox
let id = aListItem.getAttribute("addonID");
Services.obs.notifyObservers(document, AddonManager.OPTIONS_NOTIFICATION_DISPLAYED, id);
} else {
// No options, so hide the header and reset the list item
detailItem.setAttribute("optionsURL", "");
aListItem.setAttribute("optionsURL", "");
} }
// Also send a notification to match the behavior of desktop Firefox
let id = aListItem.getAttribute("addonID");
Services.obs.notifyObservers(document, AddonManager.OPTIONS_NOTIFICATION_DISPLAYED, id);
} }
} }
xhr.send(null); xhr.send(null);

View File

@ -39,10 +39,8 @@
} }
.addon-item[isDisabled="true"] .options-header, .addon-item[isDisabled="true"] .options-header,
.addon-item:not([optionsURL]) .options-header,
.addon-item[optionsURL=""] .options-header, .addon-item[optionsURL=""] .options-header,
.addon-item[isDisabled="true"] .options-box, .addon-item[isDisabled="true"] .options-box,
.addon-item:not([optionsURL]) .options-box,
.addon-item[optionsURL=""] .options-box { .addon-item[optionsURL=""] .options-box {
display: none; display: none;
} }