Skip to content

Commit

Permalink
Closes elastic#1956 - Adding a way to navigate forward/backwards thro…
Browse files Browse the repository at this point in the history
…ugh time
  • Loading branch information
simianhacker committed Feb 13, 2015
1 parent a834a81 commit 2cb1149
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 14 additions & 1 deletion src/kibana/plugins/kibana/_timepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,18 @@ define(function (require) {
}
};

function slideTime(op) {
op = op || 'subtract';
var bounds = timefilter.getBounds();
var interval = bounds.max.diff(bounds.min);
var from = bounds.min.clone()[op](interval, 'ms');
var to = bounds.max.clone()[op](interval, 'ms');
timefilter.time.from = from;
timefilter.time.to = to;
timefilter.time.mode = 'absolute';
}

$scope.previousTimeperiod = _.partial(slideTime, 'subtract');
$scope.nextTimeperiod = _.partial(slideTime, 'add');
};
});
});
4 changes: 3 additions & 1 deletion src/kibana/plugins/kibana/kibana.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<div class="spinner"></div>
</li>

<li><a ng-click="previousTimeperiod()"><i class="fa fa-arrow-left"></i></a></li>
<li ng-if="setupComplete" ng-show="timefilter.enabled" class="navbar-timepicker-container">
<a ng-click="toggleTimepicker()">
<span ng-show="timefilter.refreshInterval.value > 0" class="navbar-timepicker-auto-refresh-desc">
Expand All @@ -40,6 +41,7 @@
</span>
</a>
</li>
<li><a ng-click="nextTimeperiod()" disabled="true"><i class="fa fa-arrow-right"></i></a></li>
</ul>
<!-- /Full navbar -->
</div>
Expand All @@ -52,4 +54,4 @@
</config>

<div class="application" ng-view></div>
</div>
</div>

0 comments on commit 2cb1149

Please sign in to comment.