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:
@@ -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
|
||||
|
||||
+8
-9
@@ -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);
|
||||
|
||||
+7
-9
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user