|
@@ -22,7 +22,6 @@ export class TimePickerCtrl {
|
|
|
refresh: any;
|
|
refresh: any;
|
|
|
isUtc: boolean;
|
|
isUtc: boolean;
|
|
|
firstDayOfWeek: number;
|
|
firstDayOfWeek: number;
|
|
|
- closeDropdown: any;
|
|
|
|
|
isOpen: boolean;
|
|
isOpen: boolean;
|
|
|
|
|
|
|
|
/** @ngInject */
|
|
/** @ngInject */
|
|
@@ -32,6 +31,7 @@ export class TimePickerCtrl {
|
|
|
$rootScope.onAppEvent('shift-time-forward', () => this.move(1), $scope);
|
|
$rootScope.onAppEvent('shift-time-forward', () => this.move(1), $scope);
|
|
|
$rootScope.onAppEvent('shift-time-backward', () => this.move(-1), $scope);
|
|
$rootScope.onAppEvent('shift-time-backward', () => this.move(-1), $scope);
|
|
|
$rootScope.onAppEvent('refresh', this.onRefresh.bind(this), $scope);
|
|
$rootScope.onAppEvent('refresh', this.onRefresh.bind(this), $scope);
|
|
|
|
|
+ $rootScope.onAppEvent('closeTimepicker', this.openDropdown.bind(this), $scope);
|
|
|
|
|
|
|
|
// init options
|
|
// init options
|
|
|
this.panel = this.dashboard.timepicker;
|
|
this.panel = this.dashboard.timepicker;
|
|
@@ -96,7 +96,7 @@ export class TimePickerCtrl {
|
|
|
|
|
|
|
|
openDropdown() {
|
|
openDropdown() {
|
|
|
if (this.isOpen) {
|
|
if (this.isOpen) {
|
|
|
- this.isOpen = false;
|
|
|
|
|
|
|
+ this.closeDropdown();
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -112,6 +112,12 @@ export class TimePickerCtrl {
|
|
|
|
|
|
|
|
this.refresh.options.unshift({ text: 'off' });
|
|
this.refresh.options.unshift({ text: 'off' });
|
|
|
this.isOpen = true;
|
|
this.isOpen = true;
|
|
|
|
|
+ this.$rootScope.appEvent('timepickerOpen');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ closeDropdown() {
|
|
|
|
|
+ this.isOpen = false;
|
|
|
|
|
+ this.$rootScope.appEvent('timepickerClosed');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
applyCustom() {
|
|
applyCustom() {
|
|
@@ -120,7 +126,7 @@ export class TimePickerCtrl {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.timeSrv.setTime(this.editTimeRaw);
|
|
this.timeSrv.setTime(this.editTimeRaw);
|
|
|
- this.isOpen = false;
|
|
|
|
|
|
|
+ this.closeDropdown();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
absoluteFromChanged() {
|
|
absoluteFromChanged() {
|
|
@@ -143,7 +149,7 @@ export class TimePickerCtrl {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.timeSrv.setTime(range);
|
|
this.timeSrv.setTime(range);
|
|
|
- this.isOpen = false;
|
|
|
|
|
|
|
+ this.closeDropdown();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|