Handle touches on/in comments and right-clicks on the workspace

This commit is contained in:
Rachel Fenichel
2016-09-01 14:15:03 -07:00
parent 2774cc1663
commit 706d74c81e
2 changed files with 5 additions and 3 deletions

View File

@@ -145,11 +145,11 @@ Blockly.Bubble.unbindDragEvents_ = function() {
};
/*
* Handle a mouse-up event while dragging a bubble's border.
* Handle a mouse-up event while dragging a bubble's border or resize handle.
* @param {!Event} e Mouse up event.
* @private
*/
Blockly.Bubble.bubbleMouseUp_ = function(e) {
Blockly.Bubble.bubbleMouseUp_ = function(/*e*/) {
Blockly.clearTouchIdentifier();
Blockly.Css.setCursor(Blockly.Css.Cursor.OPEN);
Blockly.Bubble.unbindDragEvents_();
@@ -328,7 +328,7 @@ Blockly.Bubble.prototype.resizeMouseDown_ = function(e) {
this.workspace_.RTL ? -this.width_ : this.width_, this.height_));
Blockly.Bubble.onMouseUpWrapper_ = Blockly.bindEvent_(document,
'mouseup', this, Blockly.Bubble.unbindDragEvents_);
'mouseup', this, Blockly.Bubble.bubbleMouseUp_);
Blockly.Bubble.onMouseMoveWrapper_ = Blockly.bindEvent_(document,
'mousemove', this, this.resizeMouseMove_);
Blockly.hideChaff();

View File

@@ -704,6 +704,7 @@ Blockly.WorkspaceSvg.prototype.isDeleteArea = function(e) {
Blockly.WorkspaceSvg.prototype.onMouseDown_ = function(e) {
this.markFocused();
if (Blockly.isTargetInput_(e)) {
Blockly.clearTouchIdentifier();
return;
}
Blockly.terminateDrag_(); // In case mouse-up event was lost.
@@ -718,6 +719,7 @@ Blockly.WorkspaceSvg.prototype.onMouseDown_ = function(e) {
if (Blockly.isRightButton(e)) {
// Right-click.
this.showContextMenu_(e);
Blockly.clearTouchIdentifier();
} else if (this.scrollbar) {
this.dragMode_ = Blockly.DRAG_BEGIN;
// Record the current mouse position.