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
aa13a80d
Commit
aa13a80d
authored
Nov 26, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(influxdb): fixed issue with metric segment component that caused double events
parent
f00320c8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
public/app/core/directives/metric_segment.js
+13
-8
No files found.
public/app/core/directives/metric_segment.js
View file @
aa13a80d
...
@@ -27,6 +27,7 @@ function (_, $, coreModule) {
...
@@ -27,6 +27,7 @@ function (_, $, coreModule) {
var
segment
=
$scope
.
segment
;
var
segment
=
$scope
.
segment
;
var
options
=
null
;
var
options
=
null
;
var
cancelBlur
=
null
;
var
cancelBlur
=
null
;
var
linkMode
=
true
;
$input
.
appendTo
(
elem
);
$input
.
appendTo
(
elem
);
$button
.
appendTo
(
elem
);
$button
.
appendTo
(
elem
);
...
@@ -55,19 +56,21 @@ function (_, $, coreModule) {
...
@@ -55,19 +56,21 @@ function (_, $, coreModule) {
});
});
};
};
$scope
.
switchToLink
=
function
(
now
)
{
$scope
.
switchToLink
=
function
()
{
if
(
now
===
true
||
cancelBlur
)
{
if
(
linkMode
)
{
return
;
}
clearTimeout
(
cancelBlur
);
clearTimeout
(
cancelBlur
);
cancelBlur
=
null
;
cancelBlur
=
null
;
linkMode
=
true
;
$input
.
hide
();
$input
.
hide
();
$button
.
show
();
$button
.
show
();
$scope
.
updateVariableValue
(
$input
.
val
());
$scope
.
updateVariableValue
(
$input
.
val
());
}
};
else
{
// need to have long delay because the blur
$scope
.
inputBlur
=
function
()
{
// happens long before the click event on the typeahead options
// happens long before the click event on the typeahead options
// need to have long delay because the blur
cancelBlur
=
setTimeout
(
$scope
.
switchToLink
,
100
);
cancelBlur
=
setTimeout
(
$scope
.
switchToLink
,
100
);
}
};
};
$scope
.
source
=
function
(
query
,
callback
)
{
$scope
.
source
=
function
(
query
,
callback
)
{
...
@@ -98,7 +101,7 @@ function (_, $, coreModule) {
...
@@ -98,7 +101,7 @@ function (_, $, coreModule) {
}
}
$input
.
val
(
value
);
$input
.
val
(
value
);
$scope
.
switchToLink
(
true
);
$scope
.
switchToLink
();
return
value
;
return
value
;
};
};
...
@@ -139,6 +142,8 @@ function (_, $, coreModule) {
...
@@ -139,6 +142,8 @@ function (_, $, coreModule) {
$input
.
show
();
$input
.
show
();
$input
.
focus
();
$input
.
focus
();
linkMode
=
false
;
var
typeahead
=
$input
.
data
(
'typeahead'
);
var
typeahead
=
$input
.
data
(
'typeahead'
);
if
(
typeahead
)
{
if
(
typeahead
)
{
$input
.
val
(
''
);
$input
.
val
(
''
);
...
@@ -146,7 +151,7 @@ function (_, $, coreModule) {
...
@@ -146,7 +151,7 @@ function (_, $, coreModule) {
}
}
});
});
$input
.
blur
(
$scope
.
switchToLink
);
$input
.
blur
(
$scope
.
inputBlur
);
$compile
(
elem
.
contents
())(
$scope
);
$compile
(
elem
.
contents
())(
$scope
);
}
}
...
...
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