Commit 09f5ac6f authored by Neil Fraser's avatar Neil Fraser

Remove non-functioning workspace long-click.

parent fd1e63e2
This diff is collapsed.
...@@ -1208,7 +1208,7 @@ Blockly.Block.prototype.removeInput = function(name, opt_quiet) { ...@@ -1208,7 +1208,7 @@ Blockly.Block.prototype.removeInput = function(name, opt_quiet) {
/** /**
* Fetches the named input object. * Fetches the named input object.
* @param {string} name The name of the input. * @param {string} name The name of the input.
* @return {?Blockly.Input} The input object, or null of the input does not exist. * @return {Blockly.Input} The input object, or null of the input does not exist.
*/ */
Blockly.Block.prototype.getInput = function(name) { Blockly.Block.prototype.getInput = function(name) {
for (var i = 0, input; input = this.inputList[i]; i++) { for (var i = 0, input; input = this.inputList[i]; i++) {
......
...@@ -391,19 +391,15 @@ Blockly.longPid_ = 0; ...@@ -391,19 +391,15 @@ Blockly.longPid_ = 0;
* which after about a second opens the context menu. The tasks is killed * which after about a second opens the context menu. The tasks is killed
* if the touch event terminates early. * if the touch event terminates early.
* @param {!Event} e Touch start event. * @param {!Event} e Touch start event.
* @param {Blockly.Block} block The block under the touchstart event, or null * @param {!Blockly.Block|!Blockly.WorkspaceSvg} uiObject The block or workspace
* if the event was on the workspace. * under the touchstart event.
* @private * @private
*/ */
Blockly.longStart_ = function(e, block) { Blockly.longStart_ = function(e, uiObject) {
Blockly.longStop_(); Blockly.longStop_();
Blockly.longPid_ = setTimeout(function() { Blockly.longPid_ = setTimeout(function() {
e.button = 2; // Simulate a right button click. e.button = 2; // Simulate a right button click.
if (block) { uiObject.onMouseDown_(e);
block.onMouseDown_(e);
} else {
Blockly.onMouseDown_(e);
}
}, Blockly.LONGPRESS); }, Blockly.LONGPRESS);
}; };
......
...@@ -38,7 +38,7 @@ goog.require('goog.dom'); ...@@ -38,7 +38,7 @@ goog.require('goog.dom');
*/ */
Blockly.Connection = function(source, type) { Blockly.Connection = function(source, type) {
this.sourceBlock_ = source; this.sourceBlock_ = source;
/** @type {?Blockly.Connection} */ /** @type {Blockly.Connection} */
this.targetConnection = null; this.targetConnection = null;
/** @type {number} */ /** @type {number} */
this.type = type; this.type = type;
......
...@@ -180,7 +180,7 @@ Blockly.Field.prototype.setVisible = function(visible) { ...@@ -180,7 +180,7 @@ Blockly.Field.prototype.setVisible = function(visible) {
/** /**
* Sets a new change handler for editable fields. * Sets a new change handler for editable fields.
* @param {?Function} handler New change handler, or null. * @param {Function} handler New change handler, or null.
*/ */
Blockly.Field.prototype.setChangeHandler = function(handler) { Blockly.Field.prototype.setChangeHandler = function(handler) {
this.changeHandler_ = handler; this.changeHandler_ = handler;
......
...@@ -412,8 +412,6 @@ Blockly.init_ = function(mainWorkspace) { ...@@ -412,8 +412,6 @@ Blockly.init_ = function(mainWorkspace) {
// Also, 'keydown' has to be on the whole document since the browser doesn't // Also, 'keydown' has to be on the whole document since the browser doesn't
// understand a concept of focus on the SVG image. // understand a concept of focus on the SVG image.
Blockly.bindEvent_(svg, 'touchstart', null,
function(e) {Blockly.longStart_(e, null);});
Blockly.bindEvent_(window, 'resize', null, Blockly.bindEvent_(window, 'resize', null,
function() {Blockly.svgResize(mainWorkspace);}); function() {Blockly.svgResize(mainWorkspace);});
......
...@@ -47,14 +47,15 @@ Blockly.Input = function(type, name, block, connection) { ...@@ -47,14 +47,15 @@ Blockly.Input = function(type, name, block, connection) {
this.type = type; this.type = type;
/** @type {string} */ /** @type {string} */
this.name = name; this.name = name;
/** @type {!Blockly.Block} */
this.sourceBlock_ = block; this.sourceBlock_ = block;
/** @type {Blockly.Connection} */ /** @type {Blockly.Connection} */
this.connection = connection; this.connection = connection;
/** @type {Blockly.Field[]} */ /** @type {!Array.<!Blockly.Field>} */
this.fieldRow = []; this.fieldRow = [];
/** @type {number} */ /** @type {number} */
this.align = Blockly.ALIGN_LEFT; this.align = Blockly.ALIGN_LEFT;
/** @type {boolean} */
this.visible_ = true; this.visible_ = true;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment