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
075c7225
Commit
075c7225
authored
Nov 02, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ux(dashboard): worked on single row edit mode, #6442
parent
e23f8984
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
8 deletions
+20
-8
public/app/features/dashboard/model.ts
+1
-0
public/app/features/dashboard/row/add_panel.ts
+1
-1
public/app/features/dashboard/row/row.html
+2
-2
public/app/features/dashboard/row/row_ctrl.ts
+16
-5
No files found.
public/app/features/dashboard/model.ts
View file @
075c7225
...
...
@@ -192,6 +192,7 @@ export class DashboardModel {
this
.
editMode
=
!
this
.
editMode
;
this
.
updateSubmenuVisibility
();
this
.
events
.
emit
(
'edit-mode-changed'
,
this
.
editMode
);
}
setPanelFocus
(
id
)
{
...
...
public/app/features/dashboard/row/add_panel.ts
View file @
075c7225
...
...
@@ -93,7 +93,7 @@ export class AddPanelCtrl {
isNew
:
true
,
};
this
.
rowCtrl
.
dropView
=
0
;
this
.
rowCtrl
.
closeDropView
()
;
this
.
dashboard
.
addPanel
(
panel
,
this
.
row
);
this
.
$timeout
(()
=>
{
this
.
$rootScope
.
$broadcast
(
'render'
);
...
...
public/app/features/dashboard/row/row.html
View file @
075c7225
<div
ng-if=
"ctrl.
dashboard.
editMode"
>
<div
ng-if=
"ctrl.editMode"
>
<div
class=
"dash-row-header"
>
<a
class=
"dash-row-header-title"
ng-click=
"ctrl.toggleCollapse()"
>
<span
class=
"dash-row-collapse-toggle pointer"
>
...
...
@@ -40,7 +40,7 @@
</div>
</div>
<div
ng-if=
"!ctrl.
dashboard.
editMode"
>
<div
ng-if=
"!ctrl.editMode"
>
<div
class=
"row-open"
>
<div
class=
'row-tab dropdown'
ng-show=
"dashboardMeta.canEdit"
ng-hide=
"dashboard.meta.fullscreen"
>
<span
class=
"row-tab-button dropdown-toggle"
data-toggle=
"dropdown"
>
...
...
public/app/features/dashboard/row/row_ctrl.ts
View file @
075c7225
...
...
@@ -12,6 +12,7 @@ export class DashRowCtrl {
dashboard
:
any
;
row
:
any
;
dropView
:
number
;
editMode
:
boolean
;
/** @ngInject */
constructor
(
private
$scope
,
private
$rootScope
,
private
$timeout
,
private
uiSegmentSrv
,
private
$q
)
{
...
...
@@ -21,6 +22,12 @@ export class DashRowCtrl {
this
.
dropView
=
1
;
delete
this
.
row
.
isNew
;
}
this
.
dashboard
.
events
.
on
(
'edit-mode-changed'
,
this
.
editModeChanged
.
bind
(
this
),
$scope
);
}
editModeChanged
()
{
this
.
editMode
=
this
.
dashboard
.
editMode
;
}
onDrop
(
panelId
,
dropTarget
)
{
...
...
@@ -107,15 +114,20 @@ export class DashRowCtrl {
}
onMenuAddPanel
()
{
this
.
dashboard
.
toggleEditMode
()
;
this
.
editMode
=
true
;
this
.
dropView
=
1
;
}
onMenuRowOptions
()
{
this
.
dashboard
.
toggleEditMode
()
;
this
.
editMode
=
true
;
this
.
dropView
=
2
;
}
closeDropView
()
{
this
.
dropView
=
0
;
this
.
editMode
=
this
.
dashboard
.
editMode
;
}
onMenuDeleteRow
()
{
this
.
dashboard
.
removeRow
(
this
.
row
);
}
...
...
@@ -208,7 +220,7 @@ coreModule.directive('panelDropZone', function($timeout) {
}
function
updateState
()
{
if
(
scope
.
ctrl
.
dashboard
.
editMode
)
{
if
(
scope
.
ctrl
.
editMode
)
{
if
(
row
.
panels
.
length
===
0
&&
indrag
===
false
)
{
return
showPanel
(
12
,
'Empty Space'
);
}
...
...
@@ -234,8 +246,7 @@ coreModule.directive('panelDropZone', function($timeout) {
}
row
.
events
.
on
(
'span-changed'
,
updateState
,
scope
);
scope
.
$watchGroup
([
'ctrl.dashboard.editMode'
],
updateState
);
scope
.
$watchGroup
([
'ctrl.editMode'
],
updateState
);
scope
.
$on
(
"ANGULAR_DRAG_START"
,
function
()
{
indrag
=
true
;
...
...
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