avoid nagbox in block dialog

dev
Jens Mönig 2016-07-04 10:01:38 +02:00
rodzic 067d0b7bed
commit a482871a9c
1 zmienionych plików z 5 dodań i 19 usunięć

24
byob.js
Wyświetl plik

@ -108,7 +108,7 @@ WatcherMorph, Variable*/
// Global stuff //////////////////////////////////////////////////////// // Global stuff ////////////////////////////////////////////////////////
modules.byob = '2016-June-19'; modules.byob = '2016-July-04';
// Declarations // Declarations
@ -1731,24 +1731,10 @@ BlockDialogMorph.prototype.fixLayout = function () {
}; };
BlockDialogMorph.prototype.accept = function () { BlockDialogMorph.prototype.accept = function () {
var myself = this; if ((this.body instanceof InputFieldMorph) &&
var hasName = true; (this.normalizeSpaces(this.body.getValue()) === '')) {
this.edit();
this.children.forEach( } else {
function (child) {
if (child instanceof InputFieldMorph &&
myself.getInput().spec === '') {
new DialogBoxMorph().inform(
'No name',
'Please give a name to this block',
myself.world()
);
hasName = false;
}
}
);
if (hasName) {
BlockDialogMorph.uber.accept.call(this); BlockDialogMorph.uber.accept.call(this);
} }
}; };