Bug : current layer index was a string

This commit is contained in:
jdescottes 2014-04-09 23:38:35 +02:00
parent 39d7d4d8c8
commit dd4a544d7a

View File

@ -37,14 +37,14 @@
ns.LayersListController.prototype.onClick_ = function (evt) {
var el = evt.target || evt.srcElement;
var index;
if (el.nodeName == 'BUTTON') {
if (el.classList.contains('button')) {
this.onButtonClick_(el);
} else if (el.classList.contains('layer-item')) {
index = el.dataset.layerIndex;
this.piskelController.setCurrentLayerIndex(index);
this.piskelController.setCurrentLayerIndex(parseInt(index, 10));
} else if (el.classList.contains('edit-icon')) {
index = el.parentNode.dataset.layerIndex;
var layer = this.piskelController.getLayerByIndex(index);
var layer = this.piskelController.getLayerByIndex(parseInt(index, 10));
this.renameLayer_(layer);
}
};