Set ajax_in_progress attribute on <body> during ajax operations in order to facilitate testing.
git-svn-id: http://google-refine.googlecode.com/svn/trunk@416 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
aa2211221f
commit
bd24e5c7ff
@ -164,7 +164,11 @@ Gridworks.update = function(options, onFinallyDone) {
|
||||
var done = false;
|
||||
var dismissBusy = null;
|
||||
|
||||
Gridworks.setAjaxInProgress();
|
||||
|
||||
Gridworks.createUpdateFunction(options, function() {
|
||||
Gridworks.clearAjaxInProgress();
|
||||
|
||||
done = true;
|
||||
if (dismissBusy) {
|
||||
dismissBusy();
|
||||
@ -200,6 +204,8 @@ Gridworks.postProcess = function(command, params, body, updateOptions, callbacks
|
||||
dismissBusy();
|
||||
}
|
||||
|
||||
Gridworks.clearAjaxInProgress();
|
||||
|
||||
if (o.code == "error") {
|
||||
if ("onError" in callbacks) {
|
||||
try {
|
||||
@ -236,6 +242,8 @@ Gridworks.postProcess = function(command, params, body, updateOptions, callbacks
|
||||
}
|
||||
}
|
||||
|
||||
Gridworks.setAjaxInProgress();
|
||||
|
||||
$.post(
|
||||
"/command/" + command + "?" + $.param(params),
|
||||
body,
|
||||
@ -250,6 +258,14 @@ Gridworks.postProcess = function(command, params, body, updateOptions, callbacks
|
||||
}, 500);
|
||||
};
|
||||
|
||||
Gridworks.setAjaxInProgress = function() {
|
||||
$(document.body).attr("ajax_in_progress", "true");
|
||||
};
|
||||
|
||||
Gridworks.clearAjaxInProgress = function() {
|
||||
$(document.body).attr("ajax_in_progress", "false");
|
||||
};
|
||||
|
||||
/*
|
||||
* Utility model functions
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user