new nodelete mode, using icon

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@532 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Kevin Kwok 2009-09-02 23:10:20 +00:00
parent bf1517652e
commit 7010b30254
2 changed files with 5 additions and 2 deletions

View File

@ -42,7 +42,8 @@
<img style="display:none" class="tool_button" id="tool_open" src="images/open.png" title="Open Image [O]" alt="Open"/> <img style="display:none" class="tool_button" id="tool_open" src="images/open.png" title="Open Image [O]" alt="Open"/>
<img class="tool_button" id="tool_save" src="images/save.png" title="Save Image [S]" alt="Save"/> <img class="tool_button" id="tool_save" src="images/save.png" title="Save Image [S]" alt="Save"/>
<img class="tool_button" id="tool_source" src="images/source.png" title="Edit Source [U]" alt="Source"/> <img class="tool_button" id="tool_source" src="images/source.png" title="Edit Source [U]" alt="Source"/>
<img class="tool_button" title="Wave" alt="Wave State" onclick="alert(wave.getState().toString())" /> <img class="tool_button" title="Wave" src="images/wave.png" alt="Wave State" onclick="alert(wave.getState().toString())" />
<input type="check" onchange="nodelete=this.checked">
</div> </div>
<!-- History buttons --> <!-- History buttons -->

View File

@ -1,4 +1,5 @@
var shapetime = {}; var shapetime = {};
var nodelete = false;
function stateUpdated() { function stateUpdated() {
// 'state' is an object of key-value pairs that map ids to JSON serialization of SVG elements // 'state' is an object of key-value pairs that map ids to JSON serialization of SVG elements
@ -20,8 +21,9 @@ function stateUpdated() {
} }
//keys.remove(k); //keys.remove(k);
} else if(this.id != "selectorParentGroup"){ } else if(this.id != "selectorParentGroup" && !nodelete){
//console.log(this) //console.log(this)
this.parentNode.removeChild(this); this.parentNode.removeChild(this);
} }
}); });