mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Merge pull request #510 from juliandescottes/scroll-selected-layer
Issue #502: scroll selected layer into view when redrawing layer list
This commit is contained in:
commit
94b781a2e5
@ -31,6 +31,12 @@
|
|||||||
var layers = this.piskelController.getLayers();
|
var layers = this.piskelController.getLayers();
|
||||||
layers.forEach(this.addLayerItem.bind(this));
|
layers.forEach(this.addLayerItem.bind(this));
|
||||||
this.updateButtonStatus_();
|
this.updateButtonStatus_();
|
||||||
|
|
||||||
|
// Ensure the currently the selected layer is visible.
|
||||||
|
var currentLayerEl = this.layersListEl.querySelector('.current-layer-item');
|
||||||
|
if (currentLayerEl) {
|
||||||
|
currentLayerEl.scrollIntoView();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ns.LayersListController.prototype.initToggleLayerPreview_ = function () {
|
ns.LayersListController.prototype.initToggleLayerPreview_ = function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user