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
e985a9cd
Commit
e985a9cd
authored
Feb 01, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ux: fixed issue with zoom on graph caused scroll, fixes #10696
parent
1303dc7a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
14 deletions
+25
-14
public/app/core/components/scroll/scroll.ts
+16
-12
public/app/features/dashboard/dashnav/dashnav.ts
+2
-1
public/app/features/dashboard/settings/settings.ts
+5
-1
public/app/features/dashboard/view_state_srv.ts
+2
-0
No files found.
public/app/core/components/scroll/scroll.ts
View file @
e985a9cd
...
...
@@ -7,25 +7,29 @@ export function geminiScrollbar() {
restrict
:
'A'
,
link
:
function
(
scope
,
elem
,
attrs
)
{
let
scrollbar
=
new
PerfectScrollbar
(
elem
[
0
]);
let
lastPos
=
0
;
appEvents
.
on
(
'smooth-scroll-top'
,
()
=>
{
elem
.
animate
(
{
scrollTop
:
0
,
},
500
);
'dash-scroll'
,
evt
=>
{
if
(
evt
.
restore
)
{
elem
[
0
].
scrollTop
=
lastPos
;
return
;
}
lastPos
=
elem
[
0
].
scrollTop
;
if
(
evt
.
animate
)
{
elem
.
animate
({
scrollTop
:
evt
.
pos
},
500
);
}
else
{
elem
[
0
].
scrollTop
=
evt
.
pos
;
}
},
scope
);
scope
.
$on
(
'$routeChangeSuccess'
,
()
=>
{
elem
[
0
].
scrollTop
=
0
;
});
scope
.
$on
(
'$routeUpdate'
,
()
=>
{
lastPos
=
0
;
elem
[
0
].
scrollTop
=
0
;
});
...
...
public/app/features/dashboard/dashnav/dashnav.ts
View file @
e985a9cd
...
...
@@ -72,7 +72,8 @@ export class DashNavCtrl {
}
addPanel
()
{
appEvents
.
emit
(
'smooth-scroll-top'
);
appEvents
.
emit
(
'dash-scroll'
,
{
animate
:
true
,
evt
:
0
});
if
(
this
.
dashboard
.
panels
.
length
>
0
&&
this
.
dashboard
.
panels
[
0
].
type
===
'add-panel'
)
{
return
;
// Return if the "Add panel" exists already
}
...
...
public/app/features/dashboard/settings/settings.ts
View file @
e985a9cd
...
...
@@ -24,6 +24,9 @@ export class SettingsCtrl {
this
.
$scope
.
$on
(
'$destroy'
,
()
=>
{
this
.
dashboard
.
updateSubmenuVisibility
();
this
.
$rootScope
.
$broadcast
(
'refresh'
);
setTimeout
(()
=>
{
this
.
$rootScope
.
appEvent
(
'dash-scroll'
,
{
restore
:
true
});
});
});
this
.
canSaveAs
=
contextSrv
.
isEditor
;
...
...
@@ -33,7 +36,8 @@ export class SettingsCtrl {
this
.
buildSectionList
();
this
.
onRouteUpdated
();
$rootScope
.
onAppEvent
(
'$routeUpdate'
,
this
.
onRouteUpdated
.
bind
(
this
),
$scope
);
this
.
$rootScope
.
onAppEvent
(
'$routeUpdate'
,
this
.
onRouteUpdated
.
bind
(
this
),
$scope
);
this
.
$rootScope
.
appEvent
(
'dash-scroll'
,
{
animate
:
false
,
pos
:
0
});
}
buildSectionList
()
{
...
...
public/app/features/dashboard/view_state_srv.ts
View file @
e985a9cd
...
...
@@ -150,6 +150,7 @@ export class DashboardViewState {
this
.
dashboard
.
setViewMode
(
ctrl
.
panel
,
false
,
false
);
this
.
$scope
.
appEvent
(
'panel-fullscreen-exit'
,
{
panelId
:
ctrl
.
panel
.
id
});
this
.
$scope
.
appEvent
(
'dash-scroll'
,
{
restore
:
true
});
if
(
!
render
)
{
return
false
;
...
...
@@ -177,6 +178,7 @@ export class DashboardViewState {
this
.
dashboard
.
setViewMode
(
ctrl
.
panel
,
true
,
ctrl
.
editMode
);
this
.
$scope
.
appEvent
(
'panel-fullscreen-enter'
,
{
panelId
:
ctrl
.
panel
.
id
});
this
.
$scope
.
appEvent
(
'dash-scroll'
,
{
animate
:
false
,
pos
:
0
});
}
registerPanel
(
panelScope
)
{
...
...
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