Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Update text's for close tab section
Browse files Browse the repository at this point in the history
Resolves #6960

Auditors:
@bradleyrichter

Test Plan:
- text's for close tab section should be the same as image attached to the original issue
  • Loading branch information
NejcZdovc committed Feb 4, 2017
1 parent c6da55a commit 23374c4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 26 deletions.
1 change: 0 additions & 1 deletion app/common/constants/settingsEnums.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const bookmarksToolbarMode = {
const tabCloseAction = {
LAST_ACTIVE: 'lastActive',
NEXT: 'next',
FIRST: 'first',
PARENT: 'parent'
}

Expand Down
9 changes: 4 additions & 5 deletions app/extensions/brave/locales/en-US/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,9 @@ startsWith=Brave starts with
startsWithOptionLastTime=My windows / tabs from last time
startsWithOptionHomePage=Home page
startsWithOptionNewTabPage=a new tab
tabCloseActionLastActive=Last active tab
tabCloseActionNext=Next tab
tabCloseActionFirst=First tab
tabCloseActionParent=Parent tab
tabCloseActionLastActive=Select the last viewed tab
tabCloseActionNext=Select the next tab
tabCloseActionParent=Select its parent tab
newTabMode=A new tab shows
newTabBlank=blank
newTabNewTabPage=Dashboard
Expand All @@ -149,7 +148,7 @@ engineGoKey=Engine Go Key (Type First)
switchToNewTabs=Switch to new tabs immediately
paintTabs=Show tabs in page theme color
tabsPerTabPage=Number of tabs per tab set:
tabCloseAction=Which tab should be activated after the tab is closed:
tabCloseAction=When closing an active tab:
showTabPreviews=Show tab previews on hover
showHistoryMatches=Show history matches
showBookmarkMatches=Show bookmark matches
Expand Down
7 changes: 3 additions & 4 deletions js/about/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const SwitchControl = require('../components/switchControl')
const ModalOverlay = require('../components/modalOverlay')
const {SettingsList, SettingItem} = require('../../app/renderer/components/settings')
const {SettingTextbox} = require('../../app/renderer/components/textbox')
const {FormDropdown, SettingDropdown} = require('../../app/renderer/components/dropdown')
const {SettingDropdown} = require('../../app/renderer/components/dropdown')
const Button = require('../components/button')

// Tabs
Expand Down Expand Up @@ -836,14 +836,13 @@ class TabsTab extends ImmutableComponent {
</SettingDropdown>
</SettingItem>
<SettingItem dataL10nId='tabCloseAction'>
<FormDropdown
<SettingDropdown
value={getSetting(settings.TAB_CLOSE_ACTION, this.props.settings)}
onChange={changeSetting.bind(null, this.props.onChangeSetting, settings.TAB_CLOSE_ACTION)}>
<option data-l10n-id='tabCloseActionLastActive' value={tabCloseAction.LAST_ACTIVE} />
<option data-l10n-id='tabCloseActionNext' value={tabCloseAction.NEXT} />
<option data-l10n-id='tabCloseActionFirst' value={tabCloseAction.FIRST} />
<option data-l10n-id='tabCloseActionParent' value={tabCloseAction.PARENT} />
</FormDropdown>
</SettingDropdown>
</SettingItem>
<SettingCheckbox dataL10nId='switchToNewTabs' prefKey={settings.SWITCH_TO_NEW_TABS} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} />
<SettingCheckbox dataL10nId='paintTabs' prefKey={settings.PAINT_TABS} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} />
Expand Down
3 changes: 0 additions & 3 deletions js/state/frameStateUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,6 @@ function removeFrame (frames, tabs, closedFrames, frameProps, activeFrameKey, fr
case tabCloseAction.NEXT:
activeFrameIndex = ((frames.count() - 1) === framePropsIndex) ? (framePropsIndex - 1) : framePropsIndex
break
case tabCloseAction.FIRST:
activeFrameIndex = 0
break
// Default is a parent tab
default:
let parentFrameIndex = findIndexForFrameKey(frames, frameProps.get('parentFrameKey'))
Expand Down
13 changes: 0 additions & 13 deletions test/unit/state/frameStateUtilTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,19 +200,6 @@ describe('frameStateUtil', function () {
assert.equal(result.activeFrameKey, 5)
})

it('first tab action', function () {
const result = frameStateUtil.removeFrame(
frames,
tabs,
closedFrames,
frameProps,
activeFrameKey,
framePropsIndex,
tabCloseAction.FIRST
)
assert.equal(result.activeFrameKey, 2)
})

it('next tab action', function () {
const result = frameStateUtil.removeFrame(
frames,
Expand Down

0 comments on commit 23374c4

Please sign in to comment.