Put the GUI change in Tools.change in a try {...} statement.

This circumvents a bug in IE9, where classList is not implemented.
This commit is contained in:
Ophir LOJKINE 2013-12-08 21:46:42 +01:00
parent beddafedcd
commit 0ed94cb1d2

View file

@ -105,7 +105,11 @@ Tools.change = function (toolName){
//Update the GUI
var curToolName = (Tools.curTool) ? Tools.curTool.name : "";
Tools.HTML.changeTool(curToolName, toolName);
try {
Tools.HTML.changeTool(curToolName, toolName);
} catch (e) {
console.error("Unable to update the GUI with the new tool. "+e);
}
Tools.svg.style.cursor = newtool.mouseCursor || "auto";
//There is not necessarily already a curTool