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
8f9c3c83
Commit
8f9c3c83
authored
Feb 21, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib(): added teather lib and tested it with the panel menu
parent
363f36df
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
20 deletions
+22
-20
public/app/features/panel/panel_menu.js
+17
-18
public/app/system.conf.js
+1
-0
public/sass/components/_dashboard.scss
+2
-2
tasks/options/copy.js
+2
-0
No files found.
public/app/features/panel/panel_menu.js
View file @
8f9c3c83
...
@@ -2,8 +2,9 @@ define([
...
@@ -2,8 +2,9 @@ define([
'angular'
,
'angular'
,
'jquery'
,
'jquery'
,
'lodash'
,
'lodash'
,
'tether'
,
],
],
function
(
angular
,
$
,
_
)
{
function
(
angular
,
$
,
_
,
Tether
)
{
'use strict'
;
'use strict'
;
angular
angular
...
@@ -79,6 +80,7 @@ function (angular, $, _) {
...
@@ -79,6 +80,7 @@ function (angular, $, _) {
var
ctrl
=
$scope
.
ctrl
;
var
ctrl
=
$scope
.
ctrl
;
var
timeout
=
null
;
var
timeout
=
null
;
var
$menu
=
null
;
var
$menu
=
null
;
var
teather
;
elem
.
append
(
$link
);
elem
.
append
(
$link
);
...
@@ -105,6 +107,7 @@ function (angular, $, _) {
...
@@ -105,6 +107,7 @@ function (angular, $, _) {
}
}
if
(
menuScope
)
{
if
(
menuScope
)
{
teather
.
destroy
();
$menu
.
unbind
();
$menu
.
unbind
();
$menu
.
remove
();
$menu
.
remove
();
menuScope
.
$destroy
();
menuScope
.
$destroy
();
...
@@ -153,23 +156,19 @@ function (angular, $, _) {
...
@@ -153,23 +156,19 @@ function (angular, $, _) {
$scope
.
$apply
(
function
()
{
$scope
.
$apply
(
function
()
{
$compile
(
$menu
.
contents
())(
menuScope
);
$compile
(
$menu
.
contents
())(
menuScope
);
var
menuWidth
=
$menu
[
0
].
offsetWidth
;
teather
=
new
Tether
({
var
menuHeight
=
$menu
[
0
].
offsetHeight
;
element
:
$menu
,
target
:
$panelContainer
,
var
windowWidth
=
$
(
window
).
width
();
attachment
:
'bottom center'
,
var
panelLeftPos
=
$
(
elem
).
offset
().
left
;
targetAttachment
:
'top center'
,
var
panelWidth
=
$
(
elem
).
width
();
constraints
:
[
{
var
menuLeftPos
=
(
panelWidth
/
2
)
-
(
menuWidth
/
2
);
to
:
'window'
,
var
stickingOut
=
panelLeftPos
+
menuLeftPos
+
menuWidth
-
windowWidth
;
attachment
:
'together'
,
if
(
stickingOut
>
0
)
{
pin
:
true
menuLeftPos
-=
stickingOut
+
10
;
}
}
]
if
(
panelLeftPos
+
menuLeftPos
<
0
)
{
});
menuLeftPos
=
0
;
}
$menu
.
css
({
'left'
:
menuLeftPos
,
top
:
-
menuHeight
});
});
});
dismiss
(
2200
);
dismiss
(
2200
);
...
...
public/app/system.conf.js
View file @
8f9c3c83
...
@@ -2,6 +2,7 @@ System.config({
...
@@ -2,6 +2,7 @@ System.config({
defaultJSExtenions
:
true
,
defaultJSExtenions
:
true
,
baseURL
:
'public'
,
baseURL
:
'public'
,
paths
:
{
paths
:
{
'tether'
:
'vendor/npm/tether/dist/js/tether.js'
,
'moment'
:
'vendor/moment.js'
,
'moment'
:
'vendor/moment.js'
,
"jquery"
:
"vendor/jquery/dist/jquery.js"
,
"jquery"
:
"vendor/jquery/dist/jquery.js"
,
'lodash-src'
:
'vendor/lodash.js'
,
'lodash-src'
:
'vendor/lodash.js'
,
...
...
public/sass/components/_dashboard.scss
View file @
8f9c3c83
...
@@ -233,12 +233,12 @@ div.flot-text {
...
@@ -233,12 +233,12 @@ div.flot-text {
}
}
.panel-highlight
{
.panel-highlight
{
@include
box-shadow
(
"inset 0 1px 1px rgba(0,0,0,.075), 0 0 5px rgba(82,168,236, 0.8)"
);
box-shadow
:
inset
0
1px
1px
rgba
(
0
,
0
,
0
,.
075
)
,
0
0
5px
rgba
(
82
,
168
,
236
,
10
.8
)
}
}
.on-drag-hover
{
.on-drag-hover
{
.panel-container
{
.panel-container
{
@include
box-shadow
(
"inset 0 1px 1px rgba(0,0,0,.075), 0 0 5px rgba(82,168,236, 0.8)"
);
box-shadow
:
inset
0
1px
1px
rgba
(
0
,
0
,
0
,.
075
)
,
0
0
5px
rgba
(
82
,
168
,
236
,
10
.8
)
}
}
}
}
...
...
tasks/options/copy.js
View file @
8f9c3c83
...
@@ -31,6 +31,8 @@ module.exports = function(config) {
...
@@ -31,6 +31,8 @@ module.exports = function(config) {
'reflect-metadata/*.ts'
,
'reflect-metadata/*.ts'
,
'reflect-metadata/*.d.ts'
,
'reflect-metadata/*.d.ts'
,
'rxjs/**/*'
,
'rxjs/**/*'
,
'tether/**/*'
,
'tether-drop/**/*'
,
],
],
dest
:
'<%= srcDir %>/vendor/npm'
dest
:
'<%= srcDir %>/vendor/npm'
}
}
...
...
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