Bug 1804352 move richlistitem inline styling to sitePermissions.css r=settings-reviewers,Gijs

Differential Revision: https://phabricator.services.mozilla.com/D172084
This commit is contained in:
Karl Tomlinson 2023-03-16 00:32:36 +00:00
parent 1ea516e3f4
commit e2787b30fe
3 changed files with 30 additions and 8 deletions

View File

@ -20,6 +20,34 @@ hbox.website-status {
min-height: 35px; min-height: 35px;
} }
#permissionsBox > richlistitem > hbox {
flex: 1;
}
#siteCol {
flex: 3 3 auto;
}
.website-name {
flex: 3 3;
}
#statusCol {
flex: 1 auto;
}
.website-status {
flex: 1;
}
/* TODO(bug 1802993): Seems this could be on .website-name instead of label? */
#siteCol,
#statusCol,
.website-name > label,
.website-status {
width: 75px;
}
menulist.website-status { menulist.website-status {
margin: 1px; margin: 1px;
margin-inline-end: 5px; margin-inline-end: 5px;

View File

@ -401,19 +401,14 @@ var gSitePermissionsManager = {
}, },
_createPermissionListItem(permissionGroup) { _createPermissionListItem(permissionGroup) {
let width = "75px";
let richlistitem = document.createXULElement("richlistitem"); let richlistitem = document.createXULElement("richlistitem");
richlistitem.setAttribute("origin", permissionGroup.origin); richlistitem.setAttribute("origin", permissionGroup.origin);
let row = document.createXULElement("hbox"); let row = document.createXULElement("hbox");
row.setAttribute("style", "flex: 1");
let hbox = document.createXULElement("hbox"); let hbox = document.createXULElement("hbox");
let website = document.createXULElement("label"); let website = document.createXULElement("label");
website.setAttribute("value", permissionGroup.origin); website.setAttribute("value", permissionGroup.origin);
// TODO(bug 1802993): Seems this could be on the hbox instead or something?
website.setAttribute("style", `width: ${width}`);
hbox.setAttribute("class", "website-name"); hbox.setAttribute("class", "website-name");
hbox.setAttribute("style", `flex: 3 3`);
hbox.appendChild(website); hbox.appendChild(website);
let states = SitePermissions.getAvailableStates(this._type).flatMap( let states = SitePermissions.getAvailableStates(this._type).flatMap(
@ -457,7 +452,6 @@ var gSitePermissionsManager = {
this.onPermissionChange(permissionGroup, Number(siteStatus.value)); this.onPermissionChange(permissionGroup, Number(siteStatus.value));
}); });
} }
siteStatus.setAttribute("style", `flex: 1; width: ${width}`);
siteStatus.setAttribute("class", "website-status"); siteStatus.setAttribute("class", "website-status");
siteStatus.value = permissionGroup.capability; siteStatus.value = permissionGroup.capability;

View File

@ -49,9 +49,9 @@
</hbox> </hbox>
<separator class="thin"/> <separator class="thin"/>
<listheader> <listheader>
<treecol id="siteCol" data-l10n-id="permissions-site-name" style="flex: 3 3 auto; width: 75px" <treecol id="siteCol" data-l10n-id="permissions-site-name"
onclick="gSitePermissionsManager.buildPermissionsList(event.target)"/> onclick="gSitePermissionsManager.buildPermissionsList(event.target)"/>
<treecol id="statusCol" data-l10n-id="permissions-status" style="flex: 1 auto; width: 75px" <treecol id="statusCol" data-l10n-id="permissions-status"
data-isCurrentSortCol="true" data-isCurrentSortCol="true"
onclick="gSitePermissionsManager.buildPermissionsList(event.target);"/> onclick="gSitePermissionsManager.buildPermissionsList(event.target);"/>
</listheader> </listheader>