Skip to content

Commit e379a8b

Browse files
committed
Add hideTimepickerNavigation option.
This also amends global behaviour so it should be implemented elsewhere. However, it helps us now to improve Kiosk mode displays.
1 parent eea48c4 commit e379a8b

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
- Refactor machinery and user interface.
4141
- Add options `ignoreEmptyGeohashValues` and `ignoreInvalidGeohashValues`.
4242
- Add `ignoreEscapeKey` option.
43+
- Add `hideTimepickerNavigation` option.
4344

4445
## v0.2.0
4546

src/chrome.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import WorldmapCtrl from "./worldmap_ctrl";
22
import * as _ from "lodash";
3+
import $ from "jquery";
34

45
export class WorldmapChrome {
56
settings: any;
@@ -73,4 +74,12 @@ export class WorldmapChrome {
7374
return app.injector().get('keybindingSrv');
7475
}
7576

77+
removeTimePickerNav() {
78+
$('.gf-timepicker-nav').hide();
79+
}
80+
81+
restoreTimePickerNav() {
82+
$('.gf-timepicker-nav').show();
83+
}
84+
7685
}

src/worldmap_ctrl.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const panelDefaults = {
6565
linkField: null,
6666
},
6767
ignoreEscapeKey: false,
68+
hideTimepickerNavigation: false,
6869
};
6970

7071
export default class WorldmapCtrl extends MetricsPanelCtrl {
@@ -142,6 +143,12 @@ export default class WorldmapCtrl extends MetricsPanelCtrl {
142143
this.chrome.restoreEscapeKeyBinding();
143144
}
144145

146+
// Optionally hide the timepicker navigation widget.
147+
if (this.settings.hideTimepickerNavigation) {
148+
this.chrome.removeTimePickerNav();
149+
} else {
150+
this.chrome.restoreTimePickerNav();
151+
}
145152
}
146153

147154
setupEvents() {

0 commit comments

Comments
 (0)