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:
Kendall Werts 2020-02-28 12:14:48 -06:00
parent ef66bee929
commit 7f91096311
5 changed files with 25 additions and 26 deletions

View file

@ -680,7 +680,8 @@ h3.title {
font-style: italic; font-style: italic;
} }
.hover-highlight:hover { .hover-highlight:hover,
.hover-highlight:focus {
background: var(--highlight-blue); background: var(--highlight-blue);
color: #fff; color: #fff;
} }

View file

@ -530,7 +530,6 @@ window.assignManager = {
async _setOrRemoveAssignment(tabId, pageUrl, userContextId, remove) { async _setOrRemoveAssignment(tabId, pageUrl, userContextId, remove) {
let actionName; let actionName;
// https://github.com/mozilla/testpilot-containers/issues/626 // https://github.com/mozilla/testpilot-containers/issues/626
// Context menu has stored context IDs as strings, so we need to coerce // Context menu has stored context IDs as strings, so we need to coerce
// the value to a string for accurate checking // the value to a string for accurate checking

View file

@ -1215,6 +1215,13 @@ Logic.registerPanel(P_CONTAINER_EDIT, {
this._editForm.addEventListener("submit", () => { this._editForm.addEventListener("submit", () => {
this._submitForm(); this._submitForm();
}); });
Utils.addEnterHandler(document.querySelector("#create-container-cancel-link"), () => {
Logic.showPreviousPanel();
});
Utils.addEnterHandler(document.querySelector("#create-container-ok-link"), () => {
this._submitForm();
});
}, },
async _submitForm() { async _submitForm() {
@ -1275,18 +1282,10 @@ Logic.registerPanel(P_CONTAINER_EDIT, {
// Populating the panel: name and icon // Populating the panel: name and icon
document.getElementById("container-edit-title").textContent = identity.name; document.getElementById("container-edit-title").textContent = identity.name;
const userContextId = Logic.currentUserContextId(); const userContextId = Logic.currentUserContextId();
document.querySelector("#edit-container-panel .panel-footer").hidden = !!userContextId; document.querySelector("#edit-container-panel .panel-footer").hidden = !!userContextId;
document.querySelector("#edit-container-panel .delete-container").hidden = !userContextId; document.querySelector("#edit-container-panel .delete-container").hidden = !userContextId;
document.querySelector("#edit-container-options").hidden = !userContextId;
Utils.addEnterHandler(document.querySelector("#create-container-cancel-link"), () => {
Logic.showPreviousPanel();
});
Utils.addEnterHandler(document.querySelector("#create-container-ok-link"), () => {
this._submitForm();
});
Utils.addEnterHandler(document.querySelector("#manage-assigned-sites-list"), () => { Utils.addEnterHandler(document.querySelector("#manage-assigned-sites-list"), () => {
Logic.showPanel(P_CONTAINER_ASSIGNMENTS, identity); Logic.showPanel(P_CONTAINER_ASSIGNMENTS, identity);

View file

@ -102,7 +102,7 @@ const Utils = {
}, },
async alwaysOpenInContainer(identity) { async alwaysOpenInContainer(identity) {
let currentTab = await this.currentTab(); const currentTab = await this.currentTab();
const assignedUserContextId = this.userContextId(identity.cookieStoreId); const assignedUserContextId = this.userContextId(identity.cookieStoreId);
if (currentTab.cookieStoreId !== identity.cookieStoreId) { if (currentTab.cookieStoreId !== identity.cookieStoreId) {
return await browser.runtime.sendMessage({ return await browser.runtime.sendMessage({
@ -113,15 +113,13 @@ const Utils = {
tabIndex: currentTab.index +1, tabIndex: currentTab.index +1,
active:currentTab.active 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
);
} }
}; };

View file

@ -299,12 +299,14 @@
<legend class="form-header">Icon</legend> <legend class="form-header">Icon</legend>
</fieldset> </fieldset>
</form> </form>
<div class="options-header">Options</div> <div id="edit-container-options">
<div class="container-options"> <div class="options-header">Options</div>
<input type="checkbox" class="site-isolation" id="site-isolation" name="site-isolation"> <div class="container-options">
<label for="site-isolation" class="options-label">Limit to Designated Sites</label> <input type="checkbox" class="site-isolation" id="site-isolation" name="site-isolation">
</div> <label for="site-isolation" class="options-label">Limit to Designated Sites</label>
<div class="container-options options-label manage-assigned-sites-list" id="manage-assigned-sites-list">Manage Site List... </div>
<div class="container-options options-label manage-assigned-sites-list" id="manage-assigned-sites-list">Manage Site List...
</div>
</div> </div>
</div> </div>
<div class="delete-container"> <div class="delete-container">