mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
Handle touches on/in comments and right-clicks on the workspace
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user