summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Wall <richard@aziz>2010-07-11 09:08:00 +0100
committerRichard Wall <richard@aziz>2010-07-11 09:08:00 +0100
commit2578a05de1b25eddc8e133e5f9b3ed2428d5f38c (patch)
tree4bddfa5be18a0436361a16e3544cf004064aa6d2
parent537a99f97d79a570f26cba63f50b12a882f78042 (diff)
auto update on tzoffset change
-rw-r--r--jarmon.js39
1 files changed, 21 insertions, 18 deletions
diff --git a/jarmon.js b/jarmon.js
index ec54c91..efeca25 100644
--- a/jarmon.js
+++ b/jarmon.js
@@ -623,6 +623,24 @@ jarmon.timeRangeShortcuts = [
jarmon.ChartCoordinator = function(ui) {
var self = this;
this.ui = ui;
+ this.charts = [];
+
+ // Style and configuration of the range timeline
+ this.rangePreviewOptions = {
+ grid: {
+ borderWidth: 1
+ },
+ selection: {
+ mode: 'x'
+ },
+ xaxis: {
+ mode: 'time',
+ tickFormatter: jarmon.localTimeFormatter
+ },
+ yaxis: {
+ ticks: []
+ }
+ };
var options = this.ui.find('select[name="from_standard"]');
for(var i=0; i<jarmon.timeRangeShortcuts.length; i++) {
@@ -650,7 +668,9 @@ jarmon.ChartCoordinator = function(ui) {
options.append($('<option />').attr('value', i*60*60*1000).text(label));
}
- this.charts = [];
+ options.bind('change', function(e) {
+ self.update();
+ });
// Update the time ranges and redraw charts when the form is submitted
this.ui.find('[name="action"]').bind('click', function(e) {
@@ -658,23 +678,6 @@ jarmon.ChartCoordinator = function(ui) {
return false;
});
- // Style and configuration of the range timeline
- this.rangePreviewOptions = {
- grid: {
- borderWidth: 1
- },
- selection: {
- mode: 'x'
- },
- xaxis: {
- mode: 'time',
- tickFormatter: jarmon.localTimeFormatter
- },
- yaxis: {
- ticks: []
- }
- };
-
// When a selection is made on the range timeline, or any of my charts
// redraw all the charts.
this.ui.bind("plotselected", function(event, ranges) {