Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
0273365d
Commit
0273365d
authored
Apr 04, 2018
by
Patrick O'Carroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
created closeDropdown function, renamed appevent, added second appevent for open timepicker
parent
98e1404f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
14 deletions
+11
-14
public/app/core/services/keybindingSrv.ts
+2
-7
public/app/features/dashboard/timepicker/timepicker.ts
+9
-7
No files found.
public/app/core/services/keybindingSrv.ts
View file @
0273365d
...
...
@@ -23,13 +23,8 @@ export class KeybindingSrv {
this
.
setupGlobal
();
appEvents
.
on
(
'show-modal'
,
()
=>
(
this
.
modalOpen
=
true
));
$rootScope
.
onAppEvent
(
'escTimepicker'
,
()
=>
{
if
(
!
this
.
timepickerOpen
)
{
this
.
timepickerOpen
=
true
;
}
else
{
this
.
timepickerOpen
=
false
;
}
});
$rootScope
.
onAppEvent
(
'timepickerOpen'
,
()
=>
(
this
.
timepickerOpen
=
true
));
$rootScope
.
onAppEvent
(
'timepickerClosed'
,
()
=>
(
this
.
timepickerOpen
=
false
));
}
setupGlobal
()
{
...
...
public/app/features/dashboard/timepicker/timepicker.ts
View file @
0273365d
...
...
@@ -22,7 +22,6 @@ export class TimePickerCtrl {
refresh
:
any
;
isUtc
:
boolean
;
firstDayOfWeek
:
number
;
closeDropdown
:
any
;
isOpen
:
boolean
;
/** @ngInject */
...
...
@@ -96,9 +95,8 @@ export class TimePickerCtrl {
}
openDropdown
()
{
this
.
$rootScope
.
appEvent
(
'escTimepicker'
);
if
(
this
.
isOpen
)
{
this
.
isOpen
=
false
;
this
.
closeDropdown
()
;
return
;
}
...
...
@@ -114,16 +112,21 @@ export class TimePickerCtrl {
this
.
refresh
.
options
.
unshift
({
text
:
'off'
});
this
.
isOpen
=
true
;
this
.
$rootScope
.
appEvent
(
'timepickerOpen'
);
}
closeDropdown
()
{
this
.
isOpen
=
false
;
this
.
$rootScope
.
appEvent
(
'timepickerClosed'
);
}
applyCustom
()
{
this
.
$rootScope
.
appEvent
(
'escTimepicker'
);
if
(
this
.
refresh
.
value
!==
this
.
dashboard
.
refresh
)
{
this
.
timeSrv
.
setAutoRefresh
(
this
.
refresh
.
value
);
}
this
.
timeSrv
.
setTime
(
this
.
editTimeRaw
);
this
.
isOpen
=
false
;
this
.
closeDropdown
()
;
}
absoluteFromChanged
()
{
...
...
@@ -139,7 +142,6 @@ export class TimePickerCtrl {
}
setRelativeFilter
(
timespan
)
{
this
.
$rootScope
.
appEvent
(
'escTimepicker'
);
var
range
=
{
from
:
timespan
.
from
,
to
:
timespan
.
to
};
if
(
this
.
panel
.
nowDelay
&&
range
.
to
===
'now'
)
{
...
...
@@ -147,7 +149,7 @@ export class TimePickerCtrl {
}
this
.
timeSrv
.
setTime
(
range
);
this
.
isOpen
=
false
;
this
.
closeDropdown
()
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment