Skip to content

Commit

Permalink
Modify zoom out behaviour
Browse files Browse the repository at this point in the history
Zoom out now is not bound to zoom in history but uses a fixed interval
  • Loading branch information
emanuele-f committed Dec 22, 2018
1 parent 8d1a268 commit b0954b3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
18 changes: 14 additions & 4 deletions httpdocs/js/graph_utils.js
Expand Up @@ -403,11 +403,21 @@ function attachStackedChartCallback(chart, schema_name, chart_id, zoom_reset_id,
chart.fixChartButtons();
}

$chart.on('dblclick', function() {
if(current_zoom_level) {
$chart.on('dblclick', function(event) {
//if(current_zoom_level) {
// Zoom out from history
//console.log("zoom OUT");
history.back();
}
//history.back();
//} else {
// Zoom out with fixed interval
var delta = zoom_out_value;
if((params.epoch_end + delta/2)*1000 <= $.now())
delta /= 2;

$("#period_begin").data("DateTimePicker").date(new Date((params.epoch_begin - delta) * 1000));
$("#period_end").data("DateTimePicker").date(new Date((params.epoch_end + delta) * 1000));
updateChartFromPickers();
//}
});

$zoom_reset.on("click", function() {
Expand Down
2 changes: 1 addition & 1 deletion httpdocs/js/ntop.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion httpdocs/js/ntop.min.js.map

Large diffs are not rendered by default.

0 comments on commit b0954b3

Please sign in to comment.