Last active
April 23, 2018 00:08
-
-
Save a-one-d-one/48144fa28df00143afee05890d6cec33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports.showTabTitle = (state, frameKey) => { | |
const frame = frameStateUtil.getFrameByKey(state, frameKey) | |
if (frame == null) { | |
return false | |
} | |
const isNewTabPage = frameStateUtil.frameLocationMatch(frame, 'about:newtab') | |
const isActive = frameStateUtil.isFrameKeyActive(state, frameKey) | |
const isPartition = partitionState.isPartitionTab(state, frameKey) | |
const isPrivate = privateState.isPrivateTab(state, frameKey) | |
const secondaryIconVisible = !isNewTabPage && | |
(isPartition || isPrivate || isActive) && | |
tabUIState.showTabEndIcon(state, frameKey) | |
// If title is being intersected by ~half with other icons visible | |
// such as closeTab (activeTab) or session icons, do not show it | |
if (isEntryIntersected(state, 'tabs', intersection.at46) && secondaryIconVisible) { | |
return false | |
} | |
// title should never show at such intersection point | |
return !isEntryIntersected(state, 'tabs', intersection.at40) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment