summaryrefslogtreecommitdiff
path: root/src/www/syntax-editor/editor_menu.js
diff options
context:
space:
mode:
authorjohn.j.camilleri <john.j.camilleri@chalmers.se>2012-11-30 10:56:42 +0000
committerjohn.j.camilleri <john.j.camilleri@chalmers.se>2012-11-30 10:56:42 +0000
commit58c3e3db85d55cc9b746732583df83c19a9b68e0 (patch)
tree1acc94a1d19dce79c92c2c968960037908e28e4d /src/www/syntax-editor/editor_menu.js
parent3c900ee6a3a31ba8a438d876ad8cfd352e97608a (diff)
Syntax editor: in-place replacement of functions
When at a non-leaf node, refinements with identical type signatures are highlighting and can re placed without destroying the children. If not, the refinement is greyed and the user is asked to clear the current subtree first if they wish to replace it. This aspect of the UI should be polished, but at least it is obvious. Also, some substantial optimizations can still be made to cache the processed type signatures (which determine what can be replaced in-place)
Diffstat (limited to 'src/www/syntax-editor/editor_menu.js')
-rw-r--r--src/www/syntax-editor/editor_menu.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/www/syntax-editor/editor_menu.js b/src/www/syntax-editor/editor_menu.js
index 31927a26e..57000e551 100644
--- a/src/www/syntax-editor/editor_menu.js
+++ b/src/www/syntax-editor/editor_menu.js
@@ -28,8 +28,11 @@ function EditorMenu(editor,opts) {
multiple: "multiple",
class: "hidden"
}),
+ // wrap_button: button("Wrap", function(){
+ // t.editor.wrap();
+ // }),
clear_button: button("Clear", function(){
- t.editor.delete_refinement();
+ t.editor.clear_node();
}),
random_button: button("Random", function(){
t.editor.generate_random();