added hidden “clear undrop queue” option to scripts pane context menu

pull/29/head
jmoenig 2016-11-29 09:56:36 +01:00
rodzic aee9b1ab52
commit ec0b9671a9
2 zmienionych plików z 23 dodań i 3 usunięć

Wyświetl plik

@ -5359,6 +5359,7 @@ ScriptsMorph.prototype.init = function (owner) {
// initialize "undrop" queue
this.isAnimating = false;
this.dropRecord = null;
this.recordDrop();
};
@ -5690,6 +5691,7 @@ ScriptsMorph.prototype.closestBlock = function (comment, hand) {
ScriptsMorph.prototype.userMenu = function () {
var menu = new MenuMorph(this),
ide = this.parentThatIsA(IDE_Morph),
shiftClicked = this.world().currentKey === 16,
blockEditor,
myself = this,
obj = this.owner,
@ -5732,6 +5734,18 @@ ScriptsMorph.prototype.userMenu = function () {
);
}
if (hasUndropQueue) {
if (shiftClicked) {
menu.addItem(
"clear undrop queue",
function () {
myself.dropRecord = null;
myself.clearDropInfo();
myself.recordDrop();
},
'forget recorded block drops\non this pane',
new Color(100, 0, 0)
);
}
menu.addLine();
}
}
@ -6120,8 +6134,13 @@ ScriptsMorph.prototype.updateUndropControls = function () {
}
}
}
sf.toolBar.drawNew();
sf.toolBar.changed();
if (sf.toolBar.undoButton.isVisible || sf.toolBar.redoButton.isVisible) {
sf.toolBar.drawNew();
sf.toolBar.changed();
} else {
sf.removeChild(sf.toolBar);
sf.toolBar = null;
}
sf.adjustToolBar();
};

Wyświetl plik

@ -3151,4 +3151,5 @@ http://snap.berkeley.edu/run#cloud:Username=jens&ProjectName=rotation
161129
------
* Blocks: added undo / redo icons to block context menu
* Blocks: added undo / redo icons to scripts pane context menu
* Blocks: added hidden “clear undrop queue” option to scripts pane context menu