Removed options from new container menu. Tweaked new container menu to remove
dupes from opening it twice. Added focus highlighting for keyboard navigation
This commit is contained in:
parent
ef66bee929
commit
7f91096311
5 changed files with 25 additions and 26 deletions
|
@ -680,7 +680,8 @@ h3.title {
|
|||
font-style: italic;
|
||||
}
|
||||
|
||||
.hover-highlight:hover {
|
||||
.hover-highlight:hover,
|
||||
.hover-highlight:focus {
|
||||
background: var(--highlight-blue);
|
||||
color: #fff;
|
||||
}
|
||||
|
|
|
@ -530,7 +530,6 @@ window.assignManager = {
|
|||
|
||||
async _setOrRemoveAssignment(tabId, pageUrl, userContextId, remove) {
|
||||
let actionName;
|
||||
|
||||
// https://github.com/mozilla/testpilot-containers/issues/626
|
||||
// Context menu has stored context IDs as strings, so we need to coerce
|
||||
// the value to a string for accurate checking
|
||||
|
|
|
@ -1215,6 +1215,13 @@ Logic.registerPanel(P_CONTAINER_EDIT, {
|
|||
this._editForm.addEventListener("submit", () => {
|
||||
this._submitForm();
|
||||
});
|
||||
Utils.addEnterHandler(document.querySelector("#create-container-cancel-link"), () => {
|
||||
Logic.showPreviousPanel();
|
||||
});
|
||||
|
||||
Utils.addEnterHandler(document.querySelector("#create-container-ok-link"), () => {
|
||||
this._submitForm();
|
||||
});
|
||||
},
|
||||
|
||||
async _submitForm() {
|
||||
|
@ -1275,18 +1282,10 @@ Logic.registerPanel(P_CONTAINER_EDIT, {
|
|||
// Populating the panel: name and icon
|
||||
document.getElementById("container-edit-title").textContent = identity.name;
|
||||
|
||||
|
||||
const userContextId = Logic.currentUserContextId();
|
||||
document.querySelector("#edit-container-panel .panel-footer").hidden = !!userContextId;
|
||||
document.querySelector("#edit-container-panel .delete-container").hidden = !userContextId;
|
||||
|
||||
Utils.addEnterHandler(document.querySelector("#create-container-cancel-link"), () => {
|
||||
Logic.showPreviousPanel();
|
||||
});
|
||||
|
||||
Utils.addEnterHandler(document.querySelector("#create-container-ok-link"), () => {
|
||||
this._submitForm();
|
||||
});
|
||||
document.querySelector("#edit-container-options").hidden = !userContextId;
|
||||
|
||||
Utils.addEnterHandler(document.querySelector("#manage-assigned-sites-list"), () => {
|
||||
Logic.showPanel(P_CONTAINER_ASSIGNMENTS, identity);
|
||||
|
|
|
@ -102,7 +102,7 @@ const Utils = {
|
|||
},
|
||||
|
||||
async alwaysOpenInContainer(identity) {
|
||||
let currentTab = await this.currentTab();
|
||||
const currentTab = await this.currentTab();
|
||||
const assignedUserContextId = this.userContextId(identity.cookieStoreId);
|
||||
if (currentTab.cookieStoreId !== identity.cookieStoreId) {
|
||||
return await browser.runtime.sendMessage({
|
||||
|
@ -113,15 +113,13 @@ const Utils = {
|
|||
tabIndex: currentTab.index +1,
|
||||
active:currentTab.active
|
||||
});
|
||||
} else {
|
||||
currentTab = await this.currentTab();
|
||||
Utils.setOrRemoveAssignment(
|
||||
currentTab.id,
|
||||
currentTab.url,
|
||||
assignedUserContextId,
|
||||
false
|
||||
);
|
||||
}
|
||||
await Utils.setOrRemoveAssignment(
|
||||
currentTab.id,
|
||||
currentTab.url,
|
||||
assignedUserContextId,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
@ -299,12 +299,14 @@
|
|||
<legend class="form-header">Icon</legend>
|
||||
</fieldset>
|
||||
</form>
|
||||
<div class="options-header">Options</div>
|
||||
<div class="container-options">
|
||||
<input type="checkbox" class="site-isolation" id="site-isolation" name="site-isolation">
|
||||
<label for="site-isolation" class="options-label">Limit to Designated Sites</label>
|
||||
</div>
|
||||
<div class="container-options options-label manage-assigned-sites-list" id="manage-assigned-sites-list">Manage Site List...
|
||||
<div id="edit-container-options">
|
||||
<div class="options-header">Options</div>
|
||||
<div class="container-options">
|
||||
<input type="checkbox" class="site-isolation" id="site-isolation" name="site-isolation">
|
||||
<label for="site-isolation" class="options-label">Limit to Designated Sites</label>
|
||||
</div>
|
||||
<div class="container-options options-label manage-assigned-sites-list" id="manage-assigned-sites-list">Manage Site List...
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="delete-container">
|
||||
|
|
Loading…
Add table
Reference in a new issue