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
a066d7dd
Commit
a066d7dd
authored
Oct 26, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2909 from utkarshcmu/title
Added move row to top and bottom and insert row capability.
parents
cac142b1
9185c94a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
4 deletions
+44
-4
public/app/features/dashboard/rowCtrl.js
+33
-2
public/app/partials/dashboard.html
+11
-2
No files found.
public/app/features/dashboard/rowCtrl.js
View file @
a066d7dd
...
...
@@ -55,9 +55,40 @@ function (angular, _, config) {
$scope
.
move_row
=
function
(
direction
)
{
var
rowsList
=
$scope
.
dashboard
.
rows
;
var
rowIndex
=
_
.
indexOf
(
rowsList
,
$scope
.
row
);
var
newIndex
=
rowIndex
+
direction
;
var
newIndex
=
rowIndex
;
switch
(
direction
)
{
case
'up'
:
{
newIndex
=
rowIndex
-
1
;
break
;
}
case
'down'
:
{
newIndex
=
rowIndex
+
1
;
break
;
}
case
'top'
:
{
newIndex
=
0
;
break
;
}
case
'bottom'
:
{
newIndex
=
rowsList
.
length
-
1
;
break
;
}
default
:
{
newIndex
=
rowIndex
;
}
}
if
(
newIndex
>=
0
&&
newIndex
<=
(
rowsList
.
length
-
1
))
{
_
.
move
(
rowsList
,
rowIndex
,
newIndex
);
}
};
$scope
.
insert_row
=
function
(
direction
)
{
var
rowsList
=
$scope
.
dashboard
.
rows
;
var
currentRowIndex
=
_
.
indexOf
(
rowsList
,
$scope
.
row
);
$scope
.
add_row_default
();
var
newIndex
=
currentRowIndex
+
direction
;
if
(
newIndex
>=
0
&&
newIndex
<=
(
rowsList
.
length
-
1
))
{
_
.
move
(
rowsList
,
row
Index
,
rowIndex
+
direction
);
_
.
move
(
rowsList
,
row
sList
.
length
-
1
,
newIndex
);
}
};
...
...
public/app/partials/dashboard.html
View file @
a066d7dd
...
...
@@ -60,13 +60,22 @@
<li
class=
"dropdown-submenu"
>
<a
href=
"javascript:void(0);"
>
Move
</a>
<ul
class=
"dropdown-menu"
>
<li><a
ng-click=
"move_row(-1)"
>
Up
</a></li>
<li><a
ng-click=
"move_row(1)"
>
Down
</a></li>
<li><a
ng-click=
"move_row('up')"
>
Up
</a></li>
<li><a
ng-click=
"move_row('down')"
>
Down
</a></li>
<li><a
ng-click=
"move_row('top')"
>
To top
</a></li>
<li><a
ng-click=
"move_row('bottom')"
>
To Bottom
</a></li>
</ul>
</li>
<li>
<a
dash-editor-link=
"app/partials/roweditor.html"
>
Row editor
</a>
</li>
<li
class=
"dropdown-submenu"
>
<a
href=
"javascript:void(0);"
>
Insert Row
</a>
<ul
class=
"dropdown-menu"
>
<li><a
ng-click=
"insert_row(0)"
>
Above
</a></li>
<li><a
ng-click=
"insert_row(1)"
>
Below
</a></li>
</ul>
</li>
<li>
<a
ng-click=
"delete_row()"
>
Delete row
</a>
</li>
...
...
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