pixel-editor/js/_changeTool.js

18 lines
490 B
JavaScript
Raw Normal View History

2019-03-27 02:20:54 +03:00
function changeTool (selectedTool) {
//set tool and temp tje tje tpp;
currentTool = selectedTool;
currentToolTemp = selectedTool;
var tools = document.getElementById("tools-menu").children;
for (var i = 0; i < tools.length; i++) {
tools[i].classList.remove("selected");
}
//give the button of the selected tool the .selected class
document.getElementById(selectedTool+"-button").parentNode.classList.add("selected");
//change cursor
updateCursor();
}