-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sash double clicks #4702
Sash double clicks #4702
Changes from all commits
cd0ad5c
451730a
78acad8
c6a47a9
868e988
af43674
b6036c7
bfe45ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,11 +63,12 @@ export class Sash extends EventEmitter { | |
|
||
this.gesture = new Gesture(this.$e.getHTMLElement()); | ||
|
||
this.$e.on('mousedown', (e: MouseEvent) => { this.onMouseDown(e); }); | ||
this.$e.on(DOM.EventType.MOUSE_DOWN, (e: MouseEvent) => { this.onMouseDown(e); }); | ||
this.$e.on(DOM.EventType.DBLCLICK, (e: MouseEvent) => { this.emit('reset', e); }); | ||
this.$e.on(EventType.Start, (e: GestureEvent) => { this.onTouchStart(e); }); | ||
|
||
this.orientation = options.orientation || Orientation.VERTICAL; | ||
this.$e.addClass(this.orientation === Orientation.HORIZONTAL ? 'horizontal' : 'vertical'); | ||
this.$e.addClass(this.getOrientation()); | ||
|
||
this.size = options.baseSize || 5; | ||
|
||
|
@@ -91,6 +92,10 @@ export class Sash extends EventEmitter { | |
return this.$e.getHTMLElement(); | ||
} | ||
|
||
private getOrientation(): 'horizontal' | 'vertical' { | ||
return this.orientation === Orientation.HORIZONTAL ? 'horizontal' : 'vertical'; | ||
} | ||
|
||
private onMouseDown(e: MouseEvent): void { | ||
DOM.EventHelper.stop(e, false); | ||
|
||
|
@@ -112,17 +117,8 @@ export class Sash extends EventEmitter { | |
this.$e.addClass('active'); | ||
this.emit('start', startEvent); | ||
|
||
let overlayDiv = $('div').style({ | ||
position: 'absolute', | ||
top: 0, | ||
left: 0, | ||
width: '100%', | ||
height: '100%', | ||
zIndex: 1000000, | ||
cursor: this.orientation === Orientation.VERTICAL ? 'ew-resize' : 'ns-resize' | ||
}); | ||
|
||
let $window = $(window); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you explain why the changes in sash are needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I provided some explanations in the corresponding commit message, 0636b55e2ed8422f16ed7196db1ebdf33b6ac5ed. I can explain more if that’s not clear. |
||
let containerCssClass = `${this.getOrientation()}-cursor-container`; | ||
|
||
let lastCurrentX = startX; | ||
let lastCurrentY = startY; | ||
|
@@ -148,10 +144,10 @@ export class Sash extends EventEmitter { | |
this.emit('end'); | ||
|
||
$window.off('mousemove'); | ||
overlayDiv.destroy(); | ||
document.body.classList.remove(containerCssClass); | ||
}); | ||
|
||
overlayDiv.appendTo(document.body); | ||
document.body.classList.add(containerCssClass); | ||
} | ||
|
||
private onTouchStart(event: GestureEvent): void { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed?