/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
import { createSelector } from "devtools/client/shared/vendor/reselect"; import { getPrettySourceURL } from "../utils/source";
import { getSpecificSourceByURL } from "./sources"; import { isSimilarTab } from "../utils/tabs";
export const getTabs = state => state.tabs.tabs;
// Return the list of tabs which relates to an active source
export const getSourceTabs = createSelector(getTabs, tabs =>
tabs.filter(tab => tab.source)
);
/** * Gets the next tab to select when a tab closes. Heuristics: * 1. if the selected tab is available, it remains selected * 2. if it is gone, the next available tab to the left should be active * 3. if the first tab is active and closed, select the second tab
*/
export function getNewSelectedSource(state, tabList) { const { selectedLocation } = state.sources; const availableTabs = getTabs(state); if (!selectedLocation) { returnnull;
}
const selectedSource = selectedLocation.source; if (!selectedSource) { returnnull;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.