Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
qorus
grafana
Commits
e3e6f511
Commit
e3e6f511
authored
Mar 07, 2014
by
Torkel Ödegaard
Browse files
focus first input param after adding function
parent
293a2db3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/app/controllers/graphiteTarget.js
View file @
e3e6f511
...
...
@@ -10,7 +10,7 @@ function (angular, _, config, gfunc, Parser) {
var
module
=
angular
.
module
(
'
kibana.controllers
'
);
module
.
controller
(
'
GraphiteTargetCtrl
'
,
function
(
$scope
,
$http
,
filterSrv
)
{
module
.
controller
(
'
GraphiteTargetCtrl
'
,
function
(
$scope
,
$http
,
filterSrv
,
$timeout
)
{
$scope
.
init
=
function
()
{
parseTarget
();
...
...
@@ -223,7 +223,9 @@ function (angular, _, config, gfunc, Parser) {
};
$scope
.
addFunction
=
function
(
funcDef
)
{
$scope
.
functions
.
push
(
gfunc
.
createFuncInstance
(
funcDef
));
var
newFunc
=
gfunc
.
createFuncInstance
(
funcDef
);
newFunc
.
added
=
true
;
$scope
.
functions
.
push
(
newFunc
);
var
aliasFunc
=
_
.
find
(
$scope
.
functions
,
function
(
func
)
{
return
func
.
def
.
name
===
'
alias
'
;
...
...
@@ -234,7 +236,9 @@ function (angular, _, config, gfunc, Parser) {
$scope
.
functions
.
push
(
aliasFunc
);
}
$scope
.
targetChanged
();
if
(
!
funcDef
.
params
)
{
$scope
.
targetChanged
();
}
};
$scope
.
duplicate
=
function
()
{
...
...
src/app/directives/graphiteFuncEditor.js
View file @
e3e6f511
...
...
@@ -121,6 +121,13 @@ function (angular, _, $) {
$
(
'
<span>)</span>
'
).
appendTo
(
elem
);
$compile
(
elem
.
contents
())(
$scope
);
if
(
$scope
.
func
.
added
)
{
$scope
.
func
.
added
=
false
;
setTimeout
(
function
()
{
elem
.
find
(
'
a
'
).
click
();
},
10
);
}
}
};
...
...
Write
Preview
Supports
Markdown
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