library browser: import selected library on pressing enter

pull/95/head
jmoenig 2020-07-27 10:56:55 +02:00
rodzic 77384731bf
commit abb5693ff1
2 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -5,6 +5,7 @@
### 2020-07-27
* threads: fixed binding contexts to other receivers (variable scope for ASK / TELL)
* gui: updated "About Snap!" dialog box
* gui: library browser: import selected library on pressing enter
### 2020-07-26
* objects: fixed sprite speech balloon display for sounds

Wyświetl plik

@ -7766,6 +7766,7 @@ LibraryImportDialogMorph.prototype.init = function (ide, librariesData) {
this.ide = ide;
this.key = 'importLibrary';
this.action = 'importLibrary';
this.librariesData = librariesData; // [{name: , fileName: , description:}]
// I contain a cached version of the libaries I have displayed,
@ -7793,7 +7794,7 @@ LibraryImportDialogMorph.prototype.buildContents = function () {
this.initializeLibraryDescription();
this.installLibrariesList();
this.addButton('importLibrary', 'Import');
this.addButton('ok', 'Import');
this.addButton('cancel', 'Cancel');
this.setExtent(new Point(460, 455));
@ -7989,6 +7990,8 @@ LibraryImportDialogMorph.prototype.cachedLibrary = function (key) {
};
LibraryImportDialogMorph.prototype.importLibrary = function () {
if (!this.listField.selected) {return; }
var blocks,
ide = this.ide,
selectedLibrary = this.listField.selected.fileName,
@ -8011,8 +8014,6 @@ LibraryImportDialogMorph.prototype.importLibrary = function () {
}
);
}
this.destroy();
};
LibraryImportDialogMorph.prototype.displayBlocks = function (libraryKey) {