Commit 545bd082 authored by Xueyuan(Sherry) Wang's avatar Xueyuan(Sherry) Wang Committed by Evan W. Patton

Move copy before paste in workspace menu

parent 516cd43b
......@@ -770,6 +770,16 @@ Blockly.WorkspaceSvg.prototype.customContextMenu = function(menuOptions) {
};
menuOptions.push(hideAll);
// Copy all blocks to backpack option.
var backpackCopyAll = {enabled: true};
backpackCopyAll.text = Blockly.Msg.COPY_ALLBLOCKS;
backpackCopyAll.callback = function() {
if (Blockly.getMainWorkspace().hasBackpack()) {
Blockly.getMainWorkspace().getBackpack().addAllToBackpack();
}
};
menuOptions.push(backpackCopyAll);
// Retrieve from backpack option.
var backpackRetrieve = {enabled: true};
backpackRetrieve.text = Blockly.Msg.BACKPACK_GET + " (" +
......@@ -781,16 +791,6 @@ Blockly.WorkspaceSvg.prototype.customContextMenu = function(menuOptions) {
};
menuOptions.push(backpackRetrieve);
// Copy all blocks to backpack option.
var backpackCopyAll = {enabled: true};
backpackCopyAll.text = Blockly.Msg.COPY_ALLBLOCKS;
backpackCopyAll.callback = function() {
if (Blockly.getMainWorkspace().hasBackpack()) {
Blockly.getMainWorkspace().getBackpack().addAllToBackpack();
}
};
menuOptions.push(backpackCopyAll);
// Enable grid
var gridOption = {enabled: true};
gridOption.text = this.options.gridOptions['enabled'] ? Blockly.Msg.DISABLE_GRID :
......
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