load more than one scatterplot at a time but still make the dialog be cancellable
git-svn-id: http://google-refine.googlecode.com/svn/trunk@578 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
bab1e8905b
commit
78d62d3caf
@ -185,24 +185,35 @@ ScatterplotDialog.prototype._renderMatrix = function() {
|
||||
ui.browsingEngine.addFacet("scatterplot", options);
|
||||
//self._dismiss();
|
||||
});
|
||||
|
||||
|
||||
var load_images = function(data) {
|
||||
if (data.index < data.images.length && self._active) {
|
||||
data.index++;
|
||||
var elmt = $(data.images[data.index]);
|
||||
var src2 = elmt.attr("src2");
|
||||
if (src2) {
|
||||
elmt.attr("src", src2);
|
||||
elmt.removeAttr("src2");
|
||||
elmt.load(function() {
|
||||
load_images(data);
|
||||
});
|
||||
if (self._active) {
|
||||
data.batch = 0;
|
||||
var end = Math.min(data.index + data.batch_size,data.images.length);
|
||||
for (; data.index < end; data.index++) {
|
||||
load_image(data);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var load_image = function(data) {
|
||||
var img = $(data.images[data.index]);
|
||||
var src2 = img.attr("src2");
|
||||
if (src2) {
|
||||
img.attr("src", src2);
|
||||
img.removeAttr("src2");
|
||||
img.load(function() {
|
||||
data.batch++;
|
||||
if (data.batch == data.batch_size) {
|
||||
load_images(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
load_images({
|
||||
index : 0,
|
||||
batch_size: 4,
|
||||
images : container.find(".scatterplot img")
|
||||
})
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user