mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
fix : tool icon not selected when using shortcut
This commit is contained in:
parent
f0ef016309
commit
c033d65cde
@ -57,9 +57,15 @@
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ns.ToolController.prototype.selectTool_ = function(tool) {
|
ns.ToolController.prototype.selectTool_ = function(tool) {
|
||||||
console.log("Selecting Tool:" , this.currentSelectedTool.name);
|
|
||||||
this.currentSelectedTool = tool;
|
this.currentSelectedTool = tool;
|
||||||
this.activateToolOnStage_(this.currentSelectedTool);
|
this.activateToolOnStage_(this.currentSelectedTool);
|
||||||
|
|
||||||
|
var selectedToolElement = $('#tool-section .tool-icon.selected');
|
||||||
|
var toolElement = $('[data-tool-id=' + tool.instance.toolId + ']');
|
||||||
|
|
||||||
|
selectedToolElement.removeClass('selected');
|
||||||
|
toolElement.addClass('selected');
|
||||||
|
|
||||||
$.publish(Events.TOOL_SELECTED, [tool.instance]);
|
$.publish(Events.TOOL_SELECTED, [tool.instance]);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -75,10 +81,6 @@
|
|||||||
var tool = this.getToolById_(toolId);
|
var tool = this.getToolById_(toolId);
|
||||||
if (tool) {
|
if (tool) {
|
||||||
this.selectTool_(tool);
|
this.selectTool_(tool);
|
||||||
|
|
||||||
// Show tool as selected:
|
|
||||||
$('#tool-section .tool-icon.selected').removeClass('selected');
|
|
||||||
clickedTool.addClass('selected');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user