client/js/renderer/nodeeditor.js
changeset 384 6a7930a0d4d1
parent 331 0628ed75e8d3
child 385 29dcaa4c1748
--- a/client/js/renderer/nodeeditor.js	Thu Feb 05 13:19:42 2015 +0100
+++ b/client/js/renderer/nodeeditor.js	Wed Feb 11 12:33:19 2015 +0100
@@ -19,7 +19,7 @@
                 '<%= renkan.colorPicker %><span class="Rk-Edit-ColorPicker-Text"><%- renkan.translate("Choose color") %></span></div></div><% } %>' +
                 '<% if (options.show_node_editor_image) { %><div class="Rk-Edit-ImgWrap"><div class="Rk-Edit-ImgPreview"><img src="<%-node.image || node.image_placeholder%>" />' +
                 '<% if (node.clip_path) { %><svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewbox="0 0 1 1" preserveAspectRatio="none"><path style="stroke-width: .02; stroke:red; fill-opacity:.3; fill:red;" d="<%- node.clip_path %>"/></svg><% }%>' +
-                '</div></div><p><label><%-renkan.translate("Image URL:")%></label><input class="Rk-Edit-Image" type="text" value="<%-node.image%>"/></p>' +
+                '</div></div><p><label><%-renkan.translate("Image URL:")%></label><div><a class="Rk-Edit-Image-Del" href="#"></a><input class="Rk-Edit-Image" type="text" value="<%-node.image%>"/></div></p>' +
                 '<p><label><%-renkan.translate("Choose Image File:")%></label><input class="Rk-Edit-Image-File" type="file" accept="image/*"/></p><% } %>' +
                 '<% if (options.show_node_editor_creator && node.has_creator) { %><p><span class="Rk-Editor-Label"><%-renkan.translate("Created by:")%></span> <span class="Rk-UserColor" style="background:<%-node.created_by_color%>;"></span><%- shortenText(node.created_by_title, 25) %></p><% } %>' +
                 '<% if (options.change_shapes) { %><p><label><%-renkan.translate("Shapes available")%>:</label> <select class="Rk-Edit-Shape">' +
@@ -199,6 +199,12 @@
                     shiftSize(1);
                     return false;
                 });
+                
+                this.editor_$.find(".Rk-Edit-Image-Del").click(function() {
+                	_this.editor_$.find(".Rk-Edit-Image").val('');
+                	onFieldChange();
+                    return false;
+                });
             } else {
                 if (typeof this.source_representation.highlighted === "object") {
                     var titlehtml = this.source_representation.highlighted.replace(_(_model.get("title")).escape(),'<span class="Rk-Highlighted">$1</span>');