Implemented a "busy" indicator dialog, useful for preparatory steps like guessing types before showing the recon dialog.
git-svn-id: http://google-refine.googlecode.com/svn/trunk@107 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
bc412b99ea
commit
7f528c320d
@ -377,10 +377,12 @@ DataTableColumnHeaderUI.prototype._doTextTransformPrompt = function() {
|
|||||||
|
|
||||||
DataTableColumnHeaderUI.prototype._doReconcile = function() {
|
DataTableColumnHeaderUI.prototype._doReconcile = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
var dismissBusy = DialogSystem.showBusy();
|
||||||
$.post(
|
$.post(
|
||||||
"/command/guess-types-of-column?" + $.param({ project: theProject.id, columnName: this._column.headerLabel }),
|
"/command/guess-types-of-column?" + $.param({ project: theProject.id, columnName: this._column.headerLabel }),
|
||||||
null,
|
null,
|
||||||
function(data) {
|
function(data) {
|
||||||
|
dismissBusy();
|
||||||
new ReconDialog(self._column, data.code == "ok" ? data.types : []);
|
new ReconDialog(self._column, data.code == "ok" ? data.types : []);
|
||||||
},
|
},
|
||||||
"json"
|
"json"
|
||||||
|
@ -53,3 +53,17 @@ DialogSystem.createDialog = function() {
|
|||||||
return $('<div></div>').addClass("dialog-frame");
|
return $('<div></div>').addClass("dialog-frame");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
DialogSystem.showBusy = function(message) {
|
||||||
|
var frame = DialogSystem.createDialog();
|
||||||
|
frame.width("300px").css("-moz-border-radius", "25px");
|
||||||
|
|
||||||
|
var body = $('<div>').addClass("dialog-busy-body").appendTo(frame);
|
||||||
|
$('<img>').attr("src", "images/large-spinner.gif").appendTo(body);
|
||||||
|
$('<span>').text(" " + (message || "Working...")).appendTo(body);
|
||||||
|
|
||||||
|
var level = DialogSystem.showDialog(frame);
|
||||||
|
|
||||||
|
return function() {
|
||||||
|
DialogSystem.dismissUntil(level - 1);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
@ -46,3 +46,12 @@
|
|||||||
.dialog-footer button {
|
.dialog-footer button {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dialog-busy-body {
|
||||||
|
margin: 1em;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 200%;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #faa;
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user