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

Commit

Permalink
- Fixes to properly position the modals and URL suggestions
Browse files Browse the repository at this point in the history
- Toggle method for menu can now include bool; default is that it'll toggle.
  • Loading branch information
bsclifton committed Sep 12, 2016
1 parent 17e8820 commit 5a1299b
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 84 deletions.
6 changes: 4 additions & 2 deletions js/actions/windowActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -990,10 +990,12 @@ const windowActions = {
/**
* (Windows only)
* Dispatches a message to indicate the custom rendered Menubar should be toggled (shown/hidden)
* @param {boolean} isVisible (optional)
*/
toggleMenubarVisible: function () {
toggleMenubarVisible: function (isVisible) {
dispatch({
actionType: WindowConstants.WINDOW_TOGGLE_MENUBAR_VISIBLE
actionType: WindowConstants.WINDOW_TOGGLE_MENUBAR_VISIBLE,
isVisible
})
},

Expand Down
148 changes: 69 additions & 79 deletions js/components/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,9 @@ class Main extends ImmutableComponent {
noScriptIsVisible={noScriptIsVisible}
/>
<div className='topLevelEndButtons'>
{
this.extensionButtons
}
<Button iconClass='braveMenu'
l10nId='braveMenu'
className={cx({
Expand All @@ -849,89 +852,76 @@ class Main extends ImmutableComponent {
</div>
</div>
{
siteInfoIsVisible
? <SiteInfo frameProps={activeFrame}
onHide={this.onHideSiteInfo} />
: null
}
{
braveryPanelIsVisible
? <BraveryPanel frameProps={activeFrame}
activeRequestedLocation={activeRequestedLocation}
braveryPanelDetail={this.props.windowState.get('braveryPanelDetail')}
braverySettings={braverySettings}
activeSiteSettings={activeSiteSettings}
onHide={this.onHideBraveryPanel} />
: null
}
{
clearBrowsingDataPanelIsVisible
? <ClearBrowsingDataPanel
clearBrowsingDataDetail={this.props.windowState.get('clearBrowsingDataDetail')}
onHide={this.onHideClearBrowsingDataPanel} />
: null
}
{
autofillAddressPanelIsVisible
? <AutofillAddressPanel
currentDetail={this.props.windowState.getIn(['autofillAddressDetail', 'currentDetail'])}
originalDetail={this.props.windowState.getIn(['autofillAddressDetail', 'originalDetail'])}
onHide={this.onHideAutofillAddressPanel} />
: null
}
{
autofillCreditCardPanelIsVisible
? <AutofillCreditCardPanel
currentDetail={this.props.windowState.getIn(['autofillCreditCardDetail', 'currentDetail'])}
originalDetail={this.props.windowState.getIn(['autofillCreditCardDetail', 'originalDetail'])}
onHide={this.onHideAutofillCreditCardPanel} />
: null
}
{
loginRequiredDetail
? <LoginRequired loginRequiredDetail={loginRequiredDetail} tabId={activeFrame.get('tabId')} />
: null
}
{
this.props.windowState.get('bookmarkDetail')
? <AddEditBookmark sites={this.props.appState.get('sites')}
currentDetail={this.props.windowState.getIn(['bookmarkDetail', 'currentDetail'])}
originalDetail={this.props.windowState.getIn(['bookmarkDetail', 'originalDetail'])}
destinationDetail={this.props.windowState.getIn(['bookmarkDetail', 'destinationDetail'])} />
: null
}
{
noScriptIsVisible
? <NoScriptInfo frameProps={activeFrame}
onHide={this.onHideNoScript} />
: null
}
{
releaseNotesIsVisible
? <ReleaseNotes
metadata={this.props.appState.getIn(['updates', 'metadata'])}
onHide={this.onHideReleaseNotes} />
: null
}
<div className='topLevelEndButtons'>
{
this.extensionButtons
}
<Button iconClass='braveMenu'
l10nId='braveMenu'
className={cx({
navbutton: true,
braveShieldsDisabled,
braveShieldsDown: !braverySettings.shieldsUp
})}
onClick={this.onBraveMenu} />
</div>
{
menubarEnabled && !menubarVisible
menubarEnabled
? <WindowCaptionButtons windowMaximized={this.props.windowState.getIn(['ui', 'isMaximized'])} />
: null
}
</div>
{
siteInfoIsVisible
? <SiteInfo frameProps={activeFrame}
onHide={this.onHideSiteInfo} />
: null
}
{
braveryPanelIsVisible
? <BraveryPanel frameProps={activeFrame}
activeRequestedLocation={activeRequestedLocation}
braveryPanelDetail={this.props.windowState.get('braveryPanelDetail')}
braverySettings={braverySettings}
activeSiteSettings={activeSiteSettings}
onHide={this.onHideBraveryPanel} />
: null
}
{
clearBrowsingDataPanelIsVisible
? <ClearBrowsingDataPanel
clearBrowsingDataDetail={this.props.windowState.get('clearBrowsingDataDetail')}
onHide={this.onHideClearBrowsingDataPanel} />
: null
}
{
autofillAddressPanelIsVisible
? <AutofillAddressPanel
currentDetail={this.props.windowState.getIn(['autofillAddressDetail', 'currentDetail'])}
originalDetail={this.props.windowState.getIn(['autofillAddressDetail', 'originalDetail'])}
onHide={this.onHideAutofillAddressPanel} />
: null
}
{
autofillCreditCardPanelIsVisible
? <AutofillCreditCardPanel
currentDetail={this.props.windowState.getIn(['autofillCreditCardDetail', 'currentDetail'])}
originalDetail={this.props.windowState.getIn(['autofillCreditCardDetail', 'originalDetail'])}
onHide={this.onHideAutofillCreditCardPanel} />
: null
}
{
loginRequiredDetail
? <LoginRequired loginRequiredDetail={loginRequiredDetail} tabId={activeFrame.get('tabId')} />
: null
}
{
this.props.windowState.get('bookmarkDetail')
? <AddEditBookmark sites={this.props.appState.get('sites')}
currentDetail={this.props.windowState.getIn(['bookmarkDetail', 'currentDetail'])}
originalDetail={this.props.windowState.getIn(['bookmarkDetail', 'originalDetail'])}
destinationDetail={this.props.windowState.getIn(['bookmarkDetail', 'destinationDetail'])} />
: null
}
{
noScriptIsVisible
? <NoScriptInfo frameProps={activeFrame}
onHide={this.onHideNoScript} />
: null
}
{
releaseNotesIsVisible
? <ReleaseNotes
metadata={this.props.appState.getIn(['updates', 'metadata'])}
onHide={this.onHideReleaseNotes} />
: null
}

<UpdateBar updates={this.props.appState.get('updates')} />
{
Expand Down
8 changes: 6 additions & 2 deletions js/stores/windowStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -775,8 +775,12 @@ const doAction = (action) => {
break
case WindowConstants.WINDOW_TOGGLE_MENUBAR_VISIBLE:
if (getSetting(settings.AUTO_HIDE_MENU)) {
const currentStatus = windowState.getIn(['ui', 'menubar', 'isVisible'])
windowState = windowState.setIn(['ui', 'menubar', 'isVisible'], !currentStatus)
if (typeof action.isVisible === 'boolean'){
windowState = windowState.setIn(['ui', 'menubar', 'isVisible'], action.isVisible)
} else {
const currentStatus = windowState.getIn(['ui', 'menubar', 'isVisible'])
windowState = windowState.setIn(['ui', 'menubar', 'isVisible'], !currentStatus)
}
}
break

Expand Down
2 changes: 1 addition & 1 deletion less/navigationBar.less
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
flex: 1;
box-sizing: border-box;
position: relative;
overflow: auto;
overflow: visible;
white-space: nowrap;
}
.navbarMenubarBlockContainer {
Expand Down

0 comments on commit 5a1299b

Please sign in to comment.