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

View file

@ -8,7 +8,7 @@
new pskl.tools.transform.Clone()
];
this.toolIconRenderer = new pskl.tools.IconMarkupRenderer();
this.toolIconBuilder = new pskl.tools.ToolIconBuilder();
};
ns.TransformationsController.prototype.init = function () {
@ -34,7 +34,7 @@
ns.TransformationsController.prototype.createToolsDom_ = function() {
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), '');
this.toolsContainer.innerHTML = html;
};

View file

@ -1,9 +1,9 @@
(function () {
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';
var tpl = pskl.utils.Template.get('drawingTool-item-template');
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;
return pskl.utils.TooltipFormatter.format(tool.getHelpText(), tool.shortcut, descriptors);
};

View file

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