Commit d052fc5c authored by neil.fraser@gmail.com's avatar neil.fraser@gmail.com

Prevent unmovable blocks from being copied. Squish compiler warnings.

git-svn-id: http://blockly.googlecode.com/svn/trunk@1756 c400ca83-b69d-9dd7-9705-49c6b8615e23
parent f13350a7
This diff is collapsed.
......@@ -640,7 +640,7 @@ Blockly.Block.prototype.showContextMenu_ = function(e) {
var block = this;
var options = [];
if (this.isDeletable() && !block.isInFlyout) {
if (this.isDeletable() && this.isMovable() && !block.isInFlyout) {
// Option to duplicate this block.
var duplicateOption = {
text: Blockly.Msg.DUPLICATE_BLOCK,
......
......@@ -375,7 +375,8 @@ Blockly.onKeyDown_ = function(e) {
e.preventDefault();
}
} else if (e.altKey || e.ctrlKey || e.metaKey) {
if (Blockly.selected && Blockly.selected.isDeletable() &&
if (Blockly.selected &&
Blockly.selected.isDeletable() && Blockly.selected.isMovable() &&
Blockly.selected.workspace == Blockly.mainWorkspace) {
Blockly.hideChaff();
if (e.keyCode == 67) {
......
......@@ -107,8 +107,11 @@ Blockly.Blocks.addTemplate = function(details) {
'details.nextStatement must not be true.');
}
// Build up template.
var block = {};
/**
* Build up template.
* @this Blockly.Block
*/
block.init = function() {
var thisBlock = this;
// Set basic properties of block.
......
......@@ -185,7 +185,7 @@ Blockly.Realtime.initializeModel_ = function(model) {
* @param {!Blockly.Block} block The block to remove.
*/
Blockly.Realtime.removeBlock = function(block) {
Blockly.Realtime.blocksMap_.delete(block.id.toString());
Blockly.Realtime.blocksMap_['delete'](block.id.toString());
};
/**
......
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