diff --git a/src/js/controller/LayersListController.js b/src/js/controller/LayersListController.js index 9ad1dc3a..227de4fe 100644 --- a/src/js/controller/LayersListController.js +++ b/src/js/controller/LayersListController.js @@ -143,7 +143,14 @@ } else if (el.classList.contains('layer-item-opacity')) { index = pskl.utils.Dom.getData(el, 'layerIndex'); var layer = this.piskelController.getLayerAt(parseInt(index, 10)); - var opacity = window.prompt('Set layer opacity (value between 0 and 1)', layer.getOpacity()); + var opacity = layer.getOpacity(); + if (opacity == 1) { + opacity = 0.5; + } else if (opacity == 0.5) { + opacity = 0; + } else if (opacity == 0) { + opacity = 1; + } this.piskelController.setLayerOpacityAt(index, opacity); } }; @@ -182,6 +189,8 @@ this.mergeDownCurrentLayer_(); } else if (action == 'edit') { this.renameCurrentLayer_(); + } else if (action == 'alpha') { + this.changeAlphaOfLayer_(); } }; @@ -196,4 +205,6 @@ pskl.UserSettings.set(pskl.UserSettings.LAYER_OPACITY, Constants.DEFAULT.LAYER_OPACITY); } }; + + })();