mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
Merge branch 'develop' into cleanup/lint
This commit is contained in:
@@ -529,7 +529,6 @@ Blockly.BlockSvg.prototype.onMouseDown_ = function(e) {
|
||||
e.stopPropagation();
|
||||
return;
|
||||
}
|
||||
Blockly.setPageSelectable(false);
|
||||
this.workspace.markFocused();
|
||||
// Update Blockly's knowledge of its own location.
|
||||
Blockly.svgResize(this.workspace);
|
||||
@@ -574,6 +573,7 @@ Blockly.BlockSvg.prototype.onMouseDown_ = function(e) {
|
||||
}
|
||||
// This event has been handled. No need to bubble up to the document.
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -589,7 +589,6 @@ Blockly.BlockSvg.prototype.onMouseUp_ = function(e) {
|
||||
Blockly.Events.fire(
|
||||
new Blockly.Events.Ui(this, 'click', undefined, undefined));
|
||||
}
|
||||
Blockly.setPageSelectable(true);
|
||||
Blockly.terminateDrag_();
|
||||
if (Blockly.selected && Blockly.highlightedConnection_) {
|
||||
// Connect two blocks together.
|
||||
@@ -910,6 +909,7 @@ Blockly.BlockSvg.prototype.onMouseMove_ = function(e) {
|
||||
}
|
||||
// This event has been handled. No need to bubble up to the document.
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -196,7 +196,6 @@ Blockly.onMouseUp_ = function(e) {
|
||||
var workspace = Blockly.getMainWorkspace();
|
||||
Blockly.Css.setCursor(Blockly.Css.Cursor.OPEN);
|
||||
workspace.isScrolling = false;
|
||||
Blockly.setPageSelectable(true);
|
||||
// Unbind the touch event if it exists.
|
||||
if (Blockly.onTouchUpWrapper_) {
|
||||
Blockly.unbindEvent_(Blockly.onTouchUpWrapper_);
|
||||
@@ -239,6 +238,7 @@ Blockly.onMouseMove_ = function(e) {
|
||||
Blockly.longStop_();
|
||||
}
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -143,13 +143,6 @@ Blockly.Css.CONTENT = [
|
||||
'z-index: 999;',
|
||||
'}',
|
||||
|
||||
'.blocklyNonSelectable {',
|
||||
'user-select: none;',
|
||||
'-moz-user-select: none;',
|
||||
'-webkit-user-select: none;',
|
||||
'-ms-user-select: none;',
|
||||
'}',
|
||||
|
||||
'.blocklyTooltipDiv {',
|
||||
'background-color: #ffffc7;',
|
||||
'border: 1px solid #ddc;',
|
||||
|
||||
@@ -446,6 +446,7 @@ Blockly.Scrollbar.prototype.onMouseDownBar_ = function(e) {
|
||||
this.constrainKnob_(knobValue));
|
||||
this.onScroll_();
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -462,7 +463,6 @@ Blockly.Scrollbar.prototype.onMouseDownKnob_ = function(e) {
|
||||
e.stopPropagation();
|
||||
return;
|
||||
}
|
||||
Blockly.setPageSelectable(false);
|
||||
// Look up the current translation and record it.
|
||||
this.startDragKnob = parseFloat(
|
||||
this.svgKnob_.getAttribute(this.horizontal_ ? 'x' : 'y'));
|
||||
@@ -473,6 +473,7 @@ Blockly.Scrollbar.prototype.onMouseDownKnob_ = function(e) {
|
||||
Blockly.Scrollbar.onMouseMoveWrapper_ = Blockly.bindEvent_(document,
|
||||
'mousemove', this, this.onMouseMoveKnob_);
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -495,7 +496,6 @@ Blockly.Scrollbar.prototype.onMouseMoveKnob_ = function(e) {
|
||||
* @private
|
||||
*/
|
||||
Blockly.Scrollbar.prototype.onMouseUpKnob_ = function() {
|
||||
Blockly.setPageSelectable(true);
|
||||
Blockly.hideChaff(true);
|
||||
if (Blockly.Scrollbar.onMouseUpWrapper_) {
|
||||
Blockly.unbindEvent_(Blockly.Scrollbar.onMouseUpWrapper_);
|
||||
|
||||
@@ -289,19 +289,6 @@ Blockly.createSvgElement = function(name, attrs, parent, opt_workspace) {
|
||||
return e;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set css classes to allow/disallow the browser from selecting/highlighting
|
||||
* text, etc. on the page.
|
||||
* @param {boolean} selectable Whether elements on the page can be selected.
|
||||
*/
|
||||
Blockly.setPageSelectable = function(selectable) {
|
||||
if (selectable) {
|
||||
Blockly.removeClass_(document.body, 'blocklyNonSelectable');
|
||||
} else {
|
||||
Blockly.addClass_(document.body, 'blocklyNonSelectable');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Is this event a right-click?
|
||||
* @param {!Event} e Mouse event.
|
||||
|
||||
@@ -564,7 +564,6 @@ Blockly.WorkspaceSvg.prototype.isDeleteArea = function(e) {
|
||||
*/
|
||||
Blockly.WorkspaceSvg.prototype.onMouseDown_ = function(e) {
|
||||
this.markFocused();
|
||||
Blockly.setPageSelectable(false);
|
||||
if (Blockly.isTargetInput_(e)) {
|
||||
return;
|
||||
}
|
||||
@@ -607,6 +606,7 @@ Blockly.WorkspaceSvg.prototype.onMouseDown_ = function(e) {
|
||||
}
|
||||
// This event has been handled. No need to bubble up to the document.
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user