Skip to content

Commit

Permalink
Merge pull request brave#9692 from brave/tabsbar--9511
Browse files Browse the repository at this point in the history
Prevent Tab Close Button from allowing tab-tearoff
  • Loading branch information
NejcZdovc authored Jun 28, 2017
2 parents de20bc7 + 1500ecd commit c575303
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/renderer/components/tabs/content/closeTabIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class CloseTabIcon extends React.Component {
constructor (props) {
super(props)
this.onClick = this.onClick.bind(this)
this.onDragStart = this.onDragStart.bind(this)
}

get frame () {
Expand All @@ -49,6 +50,10 @@ class CloseTabIcon extends React.Component {
}
}

onDragStart (event) {
event.preventDefault()
}

mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const isPinnedTab = frameStateUtil.isPinned(currentWindow, ownProps.frameKey)
Expand Down Expand Up @@ -77,6 +82,8 @@ class CloseTabIcon extends React.Component {
className={css(this.props.showCloseIcon && styles.closeTab)}
l10nId='closeTabButton'
onClick={this.onClick}
onDragStart={this.onDragStart}
draggable='true'
/>
}
}
Expand Down
2 changes: 2 additions & 0 deletions app/renderer/components/tabs/content/tabIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class TabIcon extends ImmutableComponent {
return <div
className={this.props.className}
data-test-favicon={this.props['data-test-favicon']}
onDragStart={this.props.onDragStart}
draggable={this.props.draggable}
onClick={this.props.onClick}>
{
this.props.symbol
Expand Down

0 comments on commit c575303

Please sign in to comment.