Issue #502: scroll selected layer into view when redrawing layer list

This commit is contained in:
juliandescottes 2016-07-22 09:23:17 +02:00
parent fc0521784b
commit ba56a32b88

View File

@ -31,6 +31,12 @@
var layers = this.piskelController.getLayers();
layers.forEach(this.addLayerItem.bind(this));
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 () {