summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-03-03 23:59:53 +0200
committerAlon Levy <alon@pobox.com>2015-03-03 23:59:53 +0200
commitbcf12942bb7ad875ff46cc58992f726466318268 (patch)
tree7e850e9b29001cb10cf92b7fac54142ff29c1e45
parent73625ffd3526e85f22addf073f4e549a71670225 (diff)
client: toolbar: add delete button
-rw-r--r--res/client/css/partials/tool-bar.scss4
-rw-r--r--res/client/css/style.css3
-rw-r--r--res/templates/index.html1
-rw-r--r--src/client/view/selection.js7
4 files changed, 14 insertions, 1 deletions
diff --git a/res/client/css/partials/tool-bar.scss b/res/client/css/partials/tool-bar.scss
index 4f2d898a..501ea931 100644
--- a/res/client/css/partials/tool-bar.scss
+++ b/res/client/css/partials/tool-bar.scss
@@ -32,6 +32,10 @@
width: 80px;
}
+#btn_delete {
+ width: 80px;
+}
+
#btn_link_fan {
background: url(../img/url-icon.png);
background-position: center;
diff --git a/res/client/css/style.css b/res/client/css/style.css
index 857e2cec..8cddd1a2 100644
--- a/res/client/css/style.css
+++ b/res/client/css/style.css
@@ -724,6 +724,9 @@ p {
#btn_merge {
width: 80px; }
+#btn_delete {
+ width: 80px; }
+
#btn_link_fan {
background: url(../img/url-icon.png);
background-position: center;
diff --git a/res/templates/index.html b/res/templates/index.html
index ac9258d8..a01b4236 100644
--- a/res/templates/index.html
+++ b/res/templates/index.html
@@ -64,6 +64,7 @@ var rz_config = { // set as a global variable
</div>
<div class="tool_bar_btn" id="btn_link_fan" style="display: none" title="Link nodes in fan"></div>
<div class="tool_bar_btn" id="btn_merge" style="display: none" title="Merge nodes">Merge</div>
+ <div class="tool_bar_btn" id="btn_delete" style="display: none" title="Delete nods">Delete</div>
</div>
<div id="input-box-set-container">
<div class="input-container" id="input-container__search">
diff --git a/src/client/view/selection.js b/src/client/view/selection.js
index 974e1586..cc752058 100644
--- a/src/client/view/selection.js
+++ b/src/client/view/selection.js
@@ -228,14 +228,19 @@ var setup_merge_button = function(main_graph)
var merge_root_selection = function() {
main_graph.nodes__merge(root_nodes_ids());
},
+ delete_root_selection = function() {
+ main_graph.nodes__delete(root_nodes_ids());
+ },
link_fan_root_selection = function() {
main_graph.nodes__link_fan(root_nodes_ids());
},
merge_btn = $('#btn_merge'),
+ delete_btn = $('#btn_delete'),
link_fan_btn = $('#btn_link_fan'),
- buttons = [merge_btn, link_fan_btn];
+ buttons = [merge_btn, delete_btn, link_fan_btn];
merge_btn.asEventStream('click').onValue(merge_root_selection);
+ delete_btn.asEventStream('click').onValue(delete_root_selection);
link_fan_btn.asEventStream('click').onValue(link_fan_root_selection);
selectionChangedBus.map(function (selection) { return selection.root_nodes.length > 1; })