scroll selected custom category button into view

snap7
jmoenig 2021-10-14 12:56:43 +02:00
rodzic 99e4412f4b
commit 1d981576ac
3 zmienionych plików z 13 dodań i 2 usunięć

Wyświetl plik

@ -42,6 +42,7 @@
### 2021-10-14
* gui, byob, objects: scroll custom category buttons if there are more than 6
* gui, byob: scroll selected custom category button into view
### 2021-10-12
* scenes, store: store single palette setting per project (for making extensions)

Wyświetl plik

@ -1756,7 +1756,12 @@ BlockDialogMorph.prototype.init = function (target, action, environment) {
this.categories.buttons = [];
this.categories.refresh = function () {
this.buttons.forEach(cat => cat.refresh());
this.buttons.forEach(cat => {
cat.refresh();
if (cat.state) {
cat.scrollIntoView();
}
});
};
this.createCategoryButtons();

Wyświetl plik

@ -1267,7 +1267,12 @@ IDE_Morph.prototype.createCategories = function () {
this.categories.buttons = [];
this.categories.refresh = function () {
this.buttons.forEach(cat => cat.refresh());
this.buttons.forEach(cat => {
cat.refresh();
if (cat.state) {
cat.scrollIntoView();
}
});
};
function changePalette(category) {