app/views/sketchily/_embed.js.erb~ in sketchily-1.3.0 vs app/views/sketchily/_embed.js.erb~ in sketchily-1.4.0

- old
+ new

@@ -3,11 +3,11 @@ # Clients of this partial must supply the following variables: # id # value # hide_menu # hide_image_tool - # hide_hyperlink_tool + # show_hyperlink_tool # url %> var svgCanvas_<%= id %> = null; function submitHandler_<%= id %>(e) { @@ -46,21 +46,23 @@ var mainButton = doc.getElementById('main_button'); mainButton.parentNode.removeChild(mainButton); var toolsTop = doc.getElementById('tools_top'); toolsTop.style.left = '5px'; <% end %> + + <% unless show_hyperlink_tool %> + var hyperlinkTool = doc.getElementById('tool_make_link'); + hyperlinkTool.parentNode.removeChild(hyperlinkTool); + <% end %> <% if hide_image_tool %> var imageTool = doc.getElementById('tool_image'); imageTool.parentNode.removeChild(imageTool); <% end %> - <% if hide_hyperlink_tool %> - var hyperlinkTool = doc.getElementById('tool_make_link'); - hyperlinkTool.parentNode.removeChild(hyperlinkTool); + <% unless url %> + svgCanvas_<%= id %>.setSvgString(sketchily_decode64("<%= value.try(:squish) %>")); <% end %> - - svgCanvas_<%= id %>.setSvgString(sketchily_decode64("<%= value.try(:squish) %>")); attachSubmitHandler_<%= id %>(); } $("#svgedit_<%= id %>").load(initEmbed_<%= id %>);