Bug 608957 - Go To Page button in the addons section are clickable when there is no addon homepage available [r=mfinkle]

This commit is contained in:
Vivien Nicolas 2010-11-04 18:17:31 +01:00
Родитель 16cadb18f7
Коммит 0b706ae8af
2 изменённых файлов: 14 добавлений и 4 удалений

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

@ -173,6 +173,15 @@
</binding>
<binding id="extension-search" extends="chrome://browser/content/bindings.xml#richlistitem">
<implementation>
<field name="_showPageButton">document.getAnonymousElementByAttribute(this, "anonid", "show-page");</field>
<constructor>
<![CDATA[
if (!this.hasAttribute("homepageURL"))
this._showPageButton.setAttribute("disabled", "true");
]]>
</constructor>
</implementation>
<content orient="vertical">
<xul:hbox align="start">
<xul:image xbl:inherits="src=iconURL"/>
@ -192,7 +201,7 @@
</xul:hbox>
<xul:vbox flex="1">
<xul:hbox class="show-on-select">
<xul:button class="addon-install hide-on-install hide-on-restart" label="&addonShowPage.label;"
<xul:button anonid="show-page" class="addon-install hide-on-install hide-on-restart" label="&addonShowPage.label;"
oncommand="ExtensionsView.showPage(document.getBindingParent(this));"/>
<xul:spacer flex="1"/>
<xul:button class="addon-install hide-on-install hide-on-restart" label="&addonInstall2.label;"

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

@ -490,8 +490,8 @@ var ExtensionsView = {
},
appendSearchResults: function(aAddons, aShowRating) {
var urlproperties = [ "iconURL", "homepageURL" ];
var foundItem = false;
let urlproperties = [ "iconURL", "homepageURL" ];
let foundItem = false;
for (let i = 0; i < aAddons.length; i++) {
let addon = aAddons[i];
@ -514,6 +514,7 @@ var ExtensionsView = {
let listitem = this._createItem(addon, "search");
listitem.setAttribute("description", addon.description);
if (addon.homepageURL)
listitem.setAttribute("homepageURL", addon.homepageURL);
listitem.install = addon.install;
listitem.setAttribute("sourceURL", addon.install.sourceURI.spec);