summaryrefslogtreecommitdiff
path: root/src/client/buttons.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-04-12 00:23:33 +0200
committerAlon Levy <alon@pobox.com>2015-04-12 00:23:44 +0200
commit3255529f9db0208f8e56689e31aa626251ba1e40 (patch)
tree365fd79e258513e21a7caa96627b499d071e8643 /src/client/buttons.js
parent72ada9fea8741c2a5eaa96bd28d70f322d6622bb (diff)
client: zoom to selection button instead of automatic on selection
Diffstat (limited to 'src/client/buttons.js')
-rw-r--r--src/client/buttons.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/client/buttons.js b/src/client/buttons.js
index 514a94ba..59601762 100644
--- a/src/client/buttons.js
+++ b/src/client/buttons.js
@@ -1,7 +1,7 @@
"use strict"
-define(['jquery', 'FileSaver', 'rz_core', 'rz_api_backend'],
-function ($, saveAs, rz_core, rz_api_backend) {
+define(['jquery', 'FileSaver', 'rz_core', 'rz_api_backend', 'view/selection'],
+function ($, saveAs, rz_core, rz_api_backend, selection) {
$('.tutorial').click(function(){});
var key="#47989379";
@@ -249,5 +249,11 @@ $('#btn_zoom_in').asEventStream('click')
rz_core.main_graph_view.scale__absolute(val);
});
+$('#btn_zoom_to_selection').asEventStream('click')
+ .map(selection.selected_nodes)
+ .onValue(function (selected) {
+ rz_core.main_graph_view.nodes__user_visible(selected, true);
+ });
+
return {'buttons': 'nothing here'};
}); // define