Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d2e95303
authored
Feb 11, 2015
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix dashboard search
parent
0a6762e9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
circle/dashboard/static/dashboard/dashboard.js
+10
-6
No files found.
circle/dashboard/static/dashboard/dashboard.js
View file @
d2e95303
...
@@ -157,22 +157,26 @@ $(function () {
...
@@ -157,22 +157,26 @@ $(function () {
/* search */
/* search */
function
register_search
(
form
,
list
,
generateHTML
)
{
function
register_search
(
form
,
list
,
generateHTML
)
{
var
my_vms
=
[];
var
my_vms
=
[];
var
search_in_progress
=
false
;
/* 0 - default state
* 1 - ajax request sent
* 2 - ajax request received, we have our list of vms
*/
var
search_state
=
0
;
form
.
find
(
'input'
).
keyup
(
function
(
e
)
{
form
.
find
(
'input'
).
keyup
(
function
(
e
)
{
if
(
search_
in_progress
)
{
if
(
search_
state
==
1
)
{
return
;
return
;
}
}
// if my_vms is empty get a list of our vms
// if my_vms is empty get a list of our vms
if
(
my_vms
.
length
<
1
)
{
if
(
search_state
===
0
)
{
search_
in_progress
=
true
;
search_
state
=
1
;
var
btn
=
form
.
find
(
'button'
);
var
btn
=
form
.
find
(
'button'
);
btn
.
find
(
'i'
).
addClass
(
"fa-spinner fa-spin"
);
btn
.
find
(
'i'
).
addClass
(
"fa-spinner fa-spin"
);
$
.
get
(
form
.
prop
(
'action'
),
function
(
result
)
{
$
.
get
(
form
.
prop
(
'action'
),
function
(
result
)
{
search_
in_progress
=
false
;
search_
state
=
3
;
my_vms
=
result
;
my_vms
=
result
;
$
(
this
).
trigger
(
"keyup"
);
form
.
find
(
"input"
).
trigger
(
"keyup"
);
btn
.
find
(
'i'
).
removeClass
(
"fa-spinner fa-spin"
).
addClass
(
"fa-search"
);
btn
.
find
(
'i'
).
removeClass
(
"fa-spinner fa-spin"
).
addClass
(
"fa-search"
);
});
});
return
;
return
;
...
...
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