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
4db723ea
Commit
4db723ea
authored
Oct 24, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ux(panel resize): snap to even 12ths spans
parent
10a42cc9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
public/app/features/panel/panel_directive.ts
+12
-3
No files found.
public/app/features/panel/panel_directive.ts
View file @
4db723ea
...
...
@@ -159,19 +159,28 @@ module.directive('panelResizer', function($rootScope) {
}
scope
.
$apply
(
function
()
{
ctrl
.
render
();
//
ctrl.render();
});
}
function
dragEndHandler
()
{
ctrl
.
panel
.
span
=
Math
.
round
(
ctrl
.
panel
.
span
);
if
(
lastPanel
)
{
lastPanel
.
span
=
Math
.
round
(
lastPanel
.
span
);
}
// if close to 12
var
rowSpan
=
ctrl
.
dashboard
.
rowSpan
(
ctrl
.
row
);
if
(
rowSpan
<
12
&&
rowSpan
>
11
)
{
lastPanel
.
span
+=
12
-
rowSpan
;
}
scope
.
$apply
(
function
()
{
$rootScope
.
$broadcast
(
'render'
);
// first digest to propagate panel width change
// then render
$rootScope
.
$apply
(
function
()
{
setTimeout
(
function
()
{
$rootScope
.
$broadcast
(
'render'
);
});
});
$
(
'body'
).
off
(
'mousemove'
,
moveHandler
);
...
...
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