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
b5ef793a
Commit
b5ef793a
authored
Jan 29, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(sidemenu): pinned work started
parent
64fa9a63
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
56 additions
and
8 deletions
+56
-8
public/app/core/components/grafana_app.ts
+10
-1
public/app/core/components/navbar/navbar.html
+1
-1
public/app/core/components/sidemenu/sidemenu.html
+6
-0
public/app/core/components/sidemenu/sidemenu.ts
+4
-1
public/app/core/core_module.js
+3
-0
public/app/core/services/context_srv.js
+13
-0
public/less/navbar.less
+5
-0
public/less/sidemenu.less
+14
-5
No files found.
public/app/core/components/grafana_app.ts
View file @
b5ef793a
...
...
@@ -150,6 +150,9 @@ export function grafanaAppDirective(playlistSrv) {
scope
.
$watch
(
'contextSrv.sidemenu'
,
newVal
=>
{
if
(
newVal
!==
undefined
)
{
elem
.
toggleClass
(
'sidemenu-open'
,
scope
.
contextSrv
.
sidemenu
);
if
(
!
newVal
)
{
scope
.
contextSrv
.
setPinnedState
(
false
);
}
}
if
(
scope
.
contextSrv
.
sidemenu
)
{
ignoreSideMenuHide
=
true
;
...
...
@@ -159,6 +162,12 @@ export function grafanaAppDirective(playlistSrv) {
}
});
scope
.
$watch
(
'contextSrv.pinned'
,
newVal
=>
{
if
(
newVal
!==
undefined
)
{
elem
.
toggleClass
(
'sidemenu-pinned'
,
newVal
);
}
});
// tooltip removal fix
scope
.
$on
(
"$routeChangeSuccess"
,
function
()
{
$
(
"#tooltip, .tooltip"
).
remove
();
...
...
@@ -182,7 +191,7 @@ export function grafanaAppDirective(playlistSrv) {
}
}
// hide sidemenu
if
(
!
ignoreSideMenuHide
&&
elem
.
find
(
'.sidemenu'
).
length
>
0
)
{
if
(
!
ignoreSideMenuHide
&&
!
scope
.
contextSrv
.
pinned
&&
elem
.
find
(
'.sidemenu'
).
length
>
0
)
{
if
(
target
.
parents
(
'.sidemenu'
).
length
===
0
)
{
scope
.
$apply
(()
=>
scope
.
contextSrv
.
toggleSideMenu
());
}
...
...
public/app/core/components/navbar/navbar.html
View file @
b5ef793a
<div
class=
"navbar
navbar-static-top
"
>
<div
class=
"navbar"
>
<div
class=
"navbar-inner"
><div
class=
"container-fluid"
>
<div
class=
"top-nav-btn top-nav-menu-btn"
>
<a
class=
"pointer"
ng-click=
"ctrl.contextSrv.toggleSideMenu()"
>
...
...
public/app/core/components/sidemenu/sidemenu.html
View file @
b5ef793a
...
...
@@ -62,5 +62,11 @@
</a>
</li>
<li>
<a
class=
"sidemenu-item"
target=
"_self"
ng-click=
"ctrl.contextSrv.setPinnedState(true)"
>
<span
class=
"icon-circle sidemenu-icon"
><i
class=
"fa fa-fw fa-flag-o"
></i></span>
<span
class=
"sidemenu-item-text"
>
Pin
</span>
</a>
</li>
</ul>
public/app/core/components/sidemenu/sidemenu.ts
View file @
b5ef793a
...
...
@@ -22,8 +22,11 @@ export class SideMenuCtrl {
this
.
appSubUrl
=
config
.
appSubUrl
;
this
.
showSignout
=
this
.
contextSrv
.
isSignedIn
&&
!
config
[
'authProxyEnabled'
];
this
.
updateMenu
();
this
.
$scope
.
$on
(
'$routeChangeSuccess'
,
()
=>
{
this
.
contextSrv
.
sidemenu
=
false
;
if
(
!
this
.
contextSrv
.
pinned
)
{
this
.
contextSrv
.
sidemenu
=
false
;
}
});
}
...
...
public/app/core/core_module.js
0 → 100644
View file @
b5ef793a
///<reference path="../headers/common.d.ts" />
var
angular_1
=
require
(
'angular'
);
exports
[
"default"
]
=
angular_1
[
"default"
].
module
(
'grafana.core'
,
[
'ngRoute'
]);
public/app/core/services/context_srv.js
View file @
b5ef793a
...
...
@@ -20,10 +20,23 @@ function (angular, _, coreModule, store, config) {
return
this
.
user
.
orgRole
===
role
;
};
this
.
setPinnedState
=
function
(
val
)
{
this
.
pinned
=
val
;
store
.
set
(
'grafana.sidemenu.pinned'
,
val
);
};
this
.
toggleSideMenu
=
function
()
{
this
.
sidemenu
=
!
this
.
sidemenu
;
if
(
!
this
.
sidemenu
)
{
this
.
setPinnedState
(
false
);
}
};
this
.
pinned
=
store
.
getBool
(
'grafana.sidemenu.pinned'
,
false
);
if
(
this
.
pinned
)
{
this
.
sidemenu
=
true
;
}
this
.
version
=
config
.
buildInfo
.
version
;
this
.
lightTheme
=
false
;
this
.
user
=
new
User
();
...
...
public/less/navbar.less
View file @
b5ef793a
.navbar {
position: relative;
z-index: 1000;
}
.navbar .navbar-inner {
padding-left: 0px;
border: none;
...
...
public/less/sidemenu.less
View file @
b5ef793a
...
...
@@ -3,16 +3,14 @@
}
.sidemenu-wrapper {
position:
fixed
;
position:
absolute
;
top: 53px;
bottom: 0;
left: 0;
width: 200px;
background-color: @sideMenuBackground;
border: @sideMenuBorder;
min-height: 100%;
z-index: 101;
transform: translate3d(
-100%, 0
, 0);
transform: translate3d(
0, -100%
, 0);
visibility: hidden;
a:focus {
...
...
@@ -23,12 +21,23 @@
.sidemenu-open {
.sidemenu-wrapper {
visibility: visible;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
transition: all 0.2s;
}
}
.sidemenu-pinned {
.sidemenu-wrapper {
min-height: 100%;
}
.main-view-container {
padding-left: 210px;
}
.page-container {
padding-left: 210px;
}
}
.sidemenu {
font-weight: @baseFontWeight;
list-style: none;
...
...
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