Fixes #355 : IconMarkupRenderer:render signature changed

This commit is contained in:
jdescottes 2015-12-01 01:11:43 +01:00
parent f828471f0d
commit 4d8b093941
4 changed files with 8 additions and 8 deletions

View File

@ -21,7 +21,7 @@
new pskl.tools.drawing.ColorPicker() new pskl.tools.drawing.ColorPicker()
]; ];
this.iconMarkupRenderer = new pskl.tools.IconMarkupRenderer(); this.toolIconBuilder = new pskl.tools.ToolIconBuilder();
}; };
/** /**
@ -114,7 +114,7 @@
var html = ''; var html = '';
for (var i = 0 ; i < this.tools.length ; i++) { for (var i = 0 ; i < this.tools.length ; i++) {
var tool = this.tools[i]; var tool = this.tools[i];
html += this.iconMarkupRenderer.render(tool); html += this.toolIconBuilder.createIcon(tool);
} }
$('#tools-container').html(html); $('#tools-container').html(html);
}; };

View File

@ -8,7 +8,7 @@
new pskl.tools.transform.Clone() new pskl.tools.transform.Clone()
]; ];
this.toolIconRenderer = new pskl.tools.IconMarkupRenderer(); this.toolIconBuilder = new pskl.tools.ToolIconBuilder();
}; };
ns.TransformationsController.prototype.init = function () { ns.TransformationsController.prototype.init = function () {
@ -34,7 +34,7 @@
ns.TransformationsController.prototype.createToolsDom_ = function() { ns.TransformationsController.prototype.createToolsDom_ = function() {
var html = this.tools.reduce(function (p, tool) { var html = this.tools.reduce(function (p, tool) {
return p + this.toolIconRenderer.render(tool, tool.shortcut, 'left'); return p + this.toolIconBuilder.createIcon(tool, 'left');
}.bind(this), ''); }.bind(this), '');
this.toolsContainer.innerHTML = html; this.toolsContainer.innerHTML = html;
}; };

View File

@ -1,9 +1,9 @@
(function () { (function () {
var ns = $.namespace('pskl.tools'); var ns = $.namespace('pskl.tools');
ns.IconMarkupRenderer = function () {}; ns.ToolIconBuilder = function () {};
ns.IconMarkupRenderer.prototype.render = function (tool, tooltipPosition) { ns.ToolIconBuilder.prototype.createIcon = function (tool, tooltipPosition) {
tooltipPosition = tooltipPosition || 'right'; tooltipPosition = tooltipPosition || 'right';
var tpl = pskl.utils.Template.get('drawingTool-item-template'); var tpl = pskl.utils.Template.get('drawingTool-item-template');
return pskl.utils.Template.replace(tpl, { return pskl.utils.Template.replace(tpl, {
@ -14,7 +14,7 @@
}); });
}; };
ns.IconMarkupRenderer.prototype.getTooltipText = function(tool) { ns.ToolIconBuilder.prototype.getTooltipText = function(tool) {
var descriptors = tool.tooltipDescriptors; var descriptors = tool.tooltipDescriptors;
return pskl.utils.TooltipFormatter.format(tool.getHelpText(), tool.shortcut, descriptors); return pskl.utils.TooltipFormatter.format(tool.getHelpText(), tool.shortcut, descriptors);
}; };

View File

@ -177,7 +177,7 @@
// Tools // Tools
"js/tools/ToolsHelper.js", "js/tools/ToolsHelper.js",
"js/tools/Tool.js", "js/tools/Tool.js",
"js/tools/IconMarkupRenderer.js", "js/tools/ToolIconBuilder.js",
"js/tools/drawing/BaseTool.js", "js/tools/drawing/BaseTool.js",
"js/tools/drawing/ShapeTool.js", "js/tools/drawing/ShapeTool.js",
"js/tools/drawing/SimplePen.js", "js/tools/drawing/SimplePen.js",