Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
c2290ec8
Commit
c2290ec8
authored
Feb 27, 2017
by
Armand Bour
Committed by
Mathieu Giraud
Mar 01, 2017
Browse files
Add ajax request visual feedback
parent
3e871bdb
Changes
1
Hide whitespace changes
Inline
Side-by-side
browser/js/model.js
View file @
c2290ec8
...
...
@@ -2327,12 +2327,32 @@ changeCloneNotation: function(cloneNotationType) {
showAddManualCloneMenu
(
true
);
}
else
{
var
self
=
this
;
var
displayAjax
=
function
(
display
)
{
var
liveAjaxNode
=
document
.
getElementById
(
"
live-ajax
"
);
var
bodyNode
=
document
.
getElementsByTagName
(
"
body
"
)[
0
];
if
(
display
)
{
// var imgNode = document.createElement("img");
liveAjaxNode
.
appendChild
(
icon
(
'
icon-spin4 animate-spin
'
,
'
Sequences sent to controller segmenter
'
));
bodyNode
.
style
.
cursor
=
"
wait
"
;
}
else
{
while
(
liveAjaxNode
.
lastChild
)
{
liveAjaxNode
.
removeChild
(
liveAjaxNode
.
lastChild
);
}
bodyNode
.
style
.
cursor
=
"
default
"
;
}
};
$
.
ajax
(
url
,
{
method
:
"
POST
"
,
data
:
{
sequences
:
sequences
},
success
:
function
(
data
)
{
displayAjax
(
false
);
if
(
data
.
error
)
{
console
.
log
({
msg
:
data
.
error
,
type
:
"
flash
"
,
priority
:
2
});
return
;
}
data
.
clones
.
forEach
(
function
(
clone
)
{
clone
.
quantifiable
=
false
;
});
...
...
@@ -2342,9 +2362,12 @@ changeCloneNotation: function(cloneNotationType) {
console
.
log
({
msg
:
"
Clone(s) added!
"
,
type
:
"
flash
"
,
priority
:
1
})
},
error
:
function
(
xhr
,
textStatus
,
errorThrown
)
{
displayAjax
(
false
);
console
.
log
({
msg
:
textStatus
+
"
"
+
errorThrown
,
type
:
"
flash
"
,
priority
:
2
});
}
},
timeout
:
60000
});
displayAjax
(
true
);
}
}
}
...
...
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