More lint and eslint configuration.

This commit is contained in:
Rachel Fenichel 2016-05-25 12:53:42 -07:00
parent 8597c94a49
commit 4841f136f1
15 changed files with 105 additions and 56 deletions

View file

@ -290,7 +290,7 @@ Blockly.WorkspaceSvg.prototype.addFlyout_ = function() {
parentWorkspace: this,
RTL: this.RTL,
horizontalLayout: this.horizontalLayout,
toolboxPosition: this.options.toolboxPosition,
toolboxPosition: this.options.toolboxPosition
};
/** @type {Blockly.Flyout} */
this.flyout_ = new Blockly.Flyout(workspaceOptions);
@ -820,18 +820,7 @@ Blockly.WorkspaceSvg.prototype.showContextMenu_ = function(e) {
for (var i = 0; i < topBlocks.length; i++) {
addDeletableBlocks(topBlocks[i]);
}
var deleteOption = {
text: deleteList.length == 1 ? Blockly.Msg.DELETE_BLOCK :
Blockly.Msg.DELETE_X_BLOCKS.replace('%1', String(deleteList.length)),
enabled: deleteList.length > 0,
callback: function() {
if (deleteList.length < 2 ||
window.confirm(Blockly.Msg.DELETE_ALL_BLOCKS.replace('%1',
String(deleteList.length)))) {
deleteNext();
}
}
};
function deleteNext() {
Blockly.Events.setGroup(eventGroup);
var block = deleteList.shift();
@ -845,6 +834,19 @@ Blockly.WorkspaceSvg.prototype.showContextMenu_ = function(e) {
}
Blockly.Events.setGroup(false);
}
var deleteOption = {
text: deleteList.length == 1 ? Blockly.Msg.DELETE_BLOCK :
Blockly.Msg.DELETE_X_BLOCKS.replace('%1', String(deleteList.length)),
enabled: deleteList.length > 0,
callback: function() {
if (deleteList.length < 2 ||
window.confirm(Blockly.Msg.DELETE_ALL_BLOCKS.replace('%1',
String(deleteList.length)))) {
deleteNext();
}
}
};
menuOptions.push(deleteOption);
Blockly.ContextMenu.show(e, menuOptions, this.RTL);