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

Commit

Permalink
Prevent Tab Close Button from allowing tab-tearoff
Browse files Browse the repository at this point in the history
Auditors: @luixxiul
Close #9511
  • Loading branch information
cezaraugusto committed Jun 24, 2017
1 parent e3eab8a commit 1500ecd
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 @@ -31,6 +31,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 @@ -48,6 +49,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 @@ -76,6 +81,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 1500ecd

Please sign in to comment.