From dd4a544d7ab4777748e22ae8ef440d0e9f6f11eb Mon Sep 17 00:00:00 2001 From: jdescottes Date: Wed, 9 Apr 2014 23:38:35 +0200 Subject: [PATCH] Bug : current layer index was a string --- src/js/controller/LayersListController.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/controller/LayersListController.js b/src/js/controller/LayersListController.js index 45c85480..b3e2a76f 100644 --- a/src/js/controller/LayersListController.js +++ b/src/js/controller/LayersListController.js @@ -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); } };