mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Fix selected state for tools on load
This commit is contained in:
parent
b89409f82e
commit
f08f58328e
@ -69,11 +69,15 @@
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ns.ToolController.prototype.createToolMarkup_ = function() {
|
ns.ToolController.prototype.createToolMarkup_ = function() {
|
||||||
var currentTool, toolMarkup = '';
|
var currentTool, toolMarkup = '', extraClass;
|
||||||
// TODO(vincz): Tools rendering order is not enforced by the data stucture (this.toolInstances), fix that.
|
// TODO(vincz): Tools rendering order is not enforced by the data stucture (this.toolInstances), fix that.
|
||||||
for (var toolKey in this.toolInstances) {
|
for (var toolKey in this.toolInstances) {
|
||||||
currentTool = this.toolInstances[toolKey];
|
currentTool = this.toolInstances[toolKey];
|
||||||
toolMarkup += '<li rel="tooltip" data-placement="bottom" class="tool-icon ' + currentTool.toolId + '" data-tool-id="' + currentTool.toolId +
|
extraClass = currentTool.toolId;
|
||||||
|
if (this.currentSelectedTool == currentTool) {
|
||||||
|
extraClass = extraClass + " selected";
|
||||||
|
}
|
||||||
|
toolMarkup += '<li rel="tooltip" data-placement="right" class="tool-icon ' + extraClass + '" data-tool-id="' + currentTool.toolId +
|
||||||
'" title="' + currentTool.helpText + '"></li>';
|
'" title="' + currentTool.helpText + '"></li>';
|
||||||
}
|
}
|
||||||
$('#tools-container').html(toolMarkup);
|
$('#tools-container').html(toolMarkup);
|
||||||
|
Loading…
Reference in New Issue
Block a user