Simon Hunt

GUI -- Relabeled "Meta to select" button to "Pan/Zoom" -- makes more sense to me.

Change-Id: I331ff3aa584a42dcda5c2323b46297c9ca089a13
......@@ -1222,7 +1222,7 @@
meta = srcEv.metaKey,
shift = srcEv.shiftKey;
if ((metaSelect() && !meta) || (!metaSelect() && meta)) {
if ((panZoom() && !meta) || (!panZoom() && meta)) {
return;
}
......@@ -1388,7 +1388,7 @@
function setupZoomPan() {
function zoomed() {
if (!metaSelect() ^ !d3.event.sourceEvent.metaKey) {
if (!panZoom() ^ !d3.event.sourceEvent.metaKey) {
zoomPan(d3.event.scale, d3.event.translate);
}
}
......@@ -1444,16 +1444,16 @@
// by the framework; not generated by the view.
var showTrafficOnHover,
metaToSelect;
doPanZoom;
function addButtonBar(view) {
var bb = d3.select('#mast')
.append('span').classed('right', true).attr('id', 'bb');
metaToSelect = bb.append('span')
doPanZoom = bb.append('span')
.classed('btn', true)
.text('Meta to select')
.on('click', toggleMetaSelect);
.text('Pan/Zoom')
.on('click', togglePanZoom);
showTrafficOnHover = bb.append('span')
.classed('btn', true)
......@@ -1469,12 +1469,12 @@
return showTrafficOnHover.classed('active');
}
function toggleMetaSelect() {
metaToSelect.classed('active', !metaSelect());
function togglePanZoom() {
doPanZoom.classed('active', !panZoom());
}
function metaSelect() {
return metaToSelect.classed('active');
function panZoom() {
return doPanZoom.classed('active');
}
// ==============================
......@@ -1563,7 +1563,7 @@
.on('tick', tick);
network.drag = d3u.createDragBehavior(network.force,
selectCb, atDragEnd, metaSelect);
selectCb, atDragEnd, panZoom);
// create mask layer for when we lose connection to server.
mask = view.$div.append('div').attr('id','topo-mask');
......